The 's' replaces 1 House match at a time however the 's+' replaces The complete Room sequence at the same time with the 2nd parameter. Even so x.replaceAll("\s+", ""); is going to be much more efficient strategy for trimming spaces (if string may have numerous contiguous Areas) simply because of https://mantra-mushroom-chocolate98653.glifeblog.com/30564444/mantra-mushroom-chocolate-bars-an-overview