It suggests zero or maybe more event of whitespace figures, followed by a comma then accompanied by zero or even more event of whitespace characters.Nonetheless x.replaceAll("s+", ""); is going to be additional economical technique for trimming Areas (if string may have a number of contiguous spaces) since of potentially much less no of replacement