The 's' replaces one Room match at a time although the 's+' replaces the whole House sequence directly with the second parameter. Having said that x.replaceAll("\s+", ""); might be far more effective way of trimming spaces (if string can have multiple contiguous spaces) because of doubtless less no of replacements https://mantra-euphoria-gummies86419.blog5star.com/31787390/the-best-side-of-mantra-mushroom-chocolate-bars