The 's' replaces one Area match at a time however the 's+' replaces The entire Area sequence simultaneously with the second parameter.Nevertheless x.replaceAll("s+", ""); is going to be additional economical technique for trimming Areas (if string may have a number of contiguous spaces) since of potentially significantly less no of replacements due