stripping whitespace in java ahead of text code example Example: remove space string java a = a.replaceAll("\\s+", "");