The 's' replaces 1 Room match at a time nevertheless the 's+' replaces The entire Area sequence simultaneously with the second parameter.Even so x.replaceAll("s+", ""); might be extra effective strategy for trimming Areas (if string can have numerous contiguous spaces) because of probably less no of replacements thanks the to indisputable fact that