The 's' replaces 1 space match at any given time nevertheless the 's+' replaces the whole Place sequence at the same time with the 2nd parameter. Having said that x.replaceAll("\s+", ""); are going to be additional successful method of trimming Areas (if string can have various contiguous spaces) because of https://mantra-mushroom-chocolate65218.blogdanica.com/31288360/everything-about-s