The 's' replaces a person space match at any given time but the 's+' replaces The complete Area sequence simultaneously with the second 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 fewer no of replacem