The 's' replaces a single Area match at any given time nevertheless the 's+' replaces the whole Place sequence simultaneously with the next parameter. However x.replaceAll("\s+", ""); will be additional productive method of trimming Areas (if string can have many contiguous spaces) mainly because of potentially less no of replacements https://mantra-mushroom-chocolate89742.estate-blog.com/30719482/not-known-factual-statements-about-mantra-mushroom-chocolate