It suggests zero or more incidence of whitespace figures, followed by a comma and after that followed by zero or more occurrence of whitespace people.However x.replaceAll("s+", ""); will likely be far more productive strategy for trimming spaces (if string can have numerous contiguous Areas) mainly because of doubtless considerably less no of repla