getting rid of all spacing in a string code example Example: remove space string java a = a.replaceAll("\\s+", "");