The 's' replaces just one Room match at any given time although the 's+' replaces the whole Place sequence simultaneously with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); is going to be a lot more effective technique for trimming spaces (if string might have several contiguous Areas) due https://mantra-euphoria-gummies86419.timeblog.net/67238755/considerations-to-know-about-s