The 's' replaces 1 space match at any given time nevertheless the 's+' replaces the whole Place sequence at the same time with the 2nd parameter. Even so x.replaceAll("\s+", ""); will likely be much more efficient strategy for trimming spaces (if string might have a number of contiguous Areas) due https://simonhdvmc.blogsvila.com/31460270/little-known-facts-about-mantra-mushroom-chocolate