Everything about s
The 's' replaces a single Room match at a time even so the 's+' replaces The full Place sequence directly with the next parameter.On the other hand x.replaceAll("s+", ""); will be much more productive means of trimming spaces (if string can have multiple contiguous Areas) for the reason that of probably fewer no of replacements thanks the to proven