The 's' replaces one particular Room match at any given time though the 's+' replaces The entire space sequence without delay with the second parameter. Even so x.replaceAll("\s+", ""); is going to be a lot more efficient technique for trimming spaces (if string might have several contiguous Areas) due to https://connermeuiw.acidblog.net/62549943/considerations-to-know-about-s