The 's' replaces one particular Place match at any given time although the 's+' replaces The complete Place sequence directly with the next parameter.Having said that x.replaceAll("s+", ""); will probably be a lot more productive means of trimming spaces (if string can have multiple contiguous Areas) for the reason that of probably a lot less no of