The 's' replaces one particular Area match at any given time even so the 's+' replaces The entire House sequence directly with the second parameter. Nevertheless x.replaceAll("\s+", ""); will be extra successful means of trimming Areas (if string can have various contiguous spaces) because of doubtless less no of replacements https://mantra-mushroom-chocolate98642.bloggin-ads.com/54679042/everything-about-s