It states zero or even more occurrence of whitespace people, followed by a comma then followed by zero or even more occurrence of whitespace people. Nonetheless x.replaceAll("\s+", ""); will likely be much more economical strategy for trimming spaces (if string may have multiple contiguous spaces) simply because of doubtless significantly https://mantra-hero-bar09752.tinyblogging.com/s-an-overview-75096818