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 next parameter. However x.replaceAll("\s+", ""); are going to be additional productive method of trimming Areas (if string can have many contiguous spaces) for the reason https://zanezrhwg.loginblogin.com/38268329/new-step-by-step-map-for-s