The 's' replaces a person Area match at a time nevertheless the 's+' replaces The full Place sequence directly with the next parameter.However x.replaceAll("s+", ""); will likely be far more successful strategy for trimming Areas (if string can have several contiguous spaces) because of potentially less no of replacements thanks the to proven fact