List of usage examples for org.apache.commons.lang3 StringUtils deleteWhitespace
public static String deleteWhitespace(final String str)
Deletes all whitespaces from a String as defined by Character#isWhitespace(char) .
StringUtils.deleteWhitespace(null) = null StringUtils.deleteWhitespace("") = "" StringUtils.deleteWhitespace("abc") = "abc" StringUtils.deleteWhitespace(" ab c ") = "abc"
From source file:wo.trade.Util.java
public static String removeThoseDamnWhiteSpace(String s) { s = StringUtils.deleteWhitespace(s); StringBuilder sb = new StringBuilder(); char[] charArray = s.toCharArray(); for (char c : charArray) { if (!Character.isSpaceChar(c)) { sb.append(c);/*from w ww . j a v a 2 s. c o m*/ } } return sb.toString(); }