The 's' replaces a single space match at any given time nevertheless the 's+' replaces the whole Place sequence without delay with the next parameter. On the other hand x.replaceAll("\s+", ""); is going to be a lot more efficient technique for trimming spaces (if string might have several contiguous Areas) https://mantranootropicbar06160.ambien-blog.com/37693388/new-step-by-step-map-for-s