The 's' replaces a single space match at any given time even so the 's+' replaces the whole House sequence simultaneously with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); might be far more effective technique for trimming spaces (if string might have a number of contiguous spaces) for https://mantramushroomchocolate87530.fireblogz.com/62709578/about-s