The 's' replaces one House match at a time however the 's+' replaces The complete Room sequence at the same time with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); are going to be additional efficient technique for trimming spaces (if string might have a number of contiguous Areas) https://mantra-euphoria-gummies97530.jaiblogs.com/58395912/the-single-best-strategy-to-use-for-s