The 's' replaces just one Room match at a time even so the 's+' replaces The entire House sequence at once with the next parameter. Having said that x.replaceAll("\s+", ""); might be far more effective technique for trimming spaces (if string might have a number of contiguous spaces) because of https://mantra-nootropic-bar53196.idblogz.com/31863083/fascination-about-mantra-euphoria-gummie