The 's' replaces one particular Area match at any given time even so the 's+' replaces the whole Place sequence simultaneously 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 contiguous Areas) https://jeffreysysle.xzblogs.com/72468628/about-s