The 's' replaces one space match at a time however the 's+' replaces The complete Room sequence at the same time with the 2nd parameter. On the other hand x.replaceAll("\s+", ""); might be far more effective way of trimming spaces (if string might have a number of contiguous spaces) mainly https://mantramushroomgummies10006.buyoutblog.com/31387541/mantra-mushroom-chocolate-bars-no-further-a-mystery