It suggests zero or maybe more event of whitespace figures, followed by a comma and after that followed by zero or maybe more incidence of whitespace characters.On the other hand x.replaceAll("s+", ""); will be far more productive strategy for trimming spaces (if string can have numerous contiguous Areas) because of doubtless less no of replacement