The 's' replaces one particular Area match at any given time even so the 's+' replaces the whole House sequence simultaneously with the 2nd parameter. Even so x.replaceAll("\s+", ""); is going to be a lot more effective technique for trimming spaces (if string might have a number of contiguous Areas) https://hectorumcrh.activoblog.com/32828919/mantra-mushroom-chocolate-bars-no-further-a-mystery