The 's' replaces 1 Room match at any given time but the 's+' replaces The complete House sequence at once with the 2nd parameter.Nonetheless x.replaceAll("s+", ""); might be extra effective method of trimming Areas (if string may have a number of contiguous spaces) due to the fact of doubtless fewer no of replacements thanks the to proven fact that