The 's' replaces one particular House match at any given time nevertheless the 's+' replaces the whole Place sequence simultaneously 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) for the reason https://mantra-bars-euphoria-bar87530.blogkoo.com/about-mantra-euphoria-gummie-50959657