It states zero or maybe more occurrence of whitespace characters, accompanied by a comma after which you can accompanied by zero or maybe more prevalence of whitespace people.Even so x.replaceAll("s+", ""); will be much more effective means of trimming spaces (if string can have a number of contiguous Areas) for the reason that of probably fewer no