The 's' replaces 1 space match at any given time nevertheless the 's+' replaces the whole Place sequence simultaneously with the 2nd parameter. Nevertheless x.replaceAll("\s+", ""); will be extra successful means of trimming spaces (if string may have multiple contiguous Areas) simply because of probably significantly less no of replacements https://mr-mushies-mushroom-choco18641.blogdiloz.com/30623746/the-basic-principles-of-s