The 's' replaces just one Room match at any given time although the 's+' replaces The entire House sequence directly with the second parameter. On the other hand x.replaceAll("\s+", ""); is going to be a lot more efficient technique for trimming spaces (if string might have several contiguous Areas) since https://mantra-euphoria-gummies98641.shotblogs.com/the-single-best-strategy-to-use-for-s-45389223