The 's' replaces 1 Room match at a time nevertheless the 's+' replaces The full Room sequence directly with the next parameter.Nonetheless x.replaceAll("s+", ""); will be more productive strategy for trimming spaces (if string can have many contiguous spaces) since of doubtless much less no of replacements due the to proven fact that regex s+ match… Read More