The 's' replaces one Area match at a time however the 's+' replaces The entire Area sequence at the same time with the second parameter.On the other hand x.replaceAll("s+", ""); will be much more effective method of trimming spaces (if string might have various contiguous Areas) due to the fact of doubtless considerably less no of replacements beca