how to get rid off the all white spae in a strng code example Example: java 8 remove spaces from string a.replaceAll("\\s+","");