The 's' replaces a person 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 probably be a lot more productive strategy for trimming spaces (if string can have numerous contiguous spaces) because of potentially much less no of replacements… Read More