The 's' replaces one Area match at any given time though the 's+' replaces The entire Room sequence directly with the 2nd parameter.On the other hand x.replaceAll("s+", ""); will be much more productive technique for trimming Areas (if string may have multiple contiguous Areas) for the reason that of probably less no of replacements thanks the to u