The 's' replaces a single space match at any given time nevertheless the 's+' replaces the whole Place sequence at the same time with the 2nd parameter. Having said that x.replaceAll("\s+", ""); might be far more effective way of trimming spaces (if string might have a number of contiguous Areas) https://remingtonwodrg.blog-ezine.com/31435977/mantra-euphoria-gummie-options