The 's' replaces a single space match at any given time nevertheless the 's+' replaces the whole Place sequence at the same time with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); is going to be a lot more efficient strategy for trimming spaces (if string may have numerous https://mantra-mushroom-chocolate98653.glifeblog.com/30564444/mantra-mushroom-chocolate-bars-an-overview