The 's' replaces a single Area match at any given time even so the 's+' replaces the whole Room sequence without delay with the next 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) since https://griffinzbdqt.nizarblog.com/31486582/not-known-factual-statements-about-mantra-mushroom-chocolate-bars