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. Having said that x.replaceAll("\s+", ""); are going to be additional efficient strategy for trimming spaces (if string may have several contiguous Areas) due to the https://raymondundsi.blogsuperapp.com/31876565/the-single-best-strategy-to-use-for-s