The 's' replaces a single space match at any given time however the 's+' replaces The complete Room sequence at the same time with the 2nd parameter. However x.replaceAll("\s+", ""); are going to be additional productive way of trimming Areas (if string can have many contiguous spaces) for the reason https://mantra-chocolate-bars54207.theobloggers.com/37522890/about-s