The 's' replaces 1 space match at any given time however the 's+' replaces the whole Place sequence simultaneously with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); might be far more effective way of trimming spaces (if string might have a number of contiguous spaces) simply because of https://remingtonumzrj.jaiblogs.com/58346953/everything-about-s