code: public static String deleteWhitespace(String str) {
        if (isEmpty(str)) {
            return str;
        }
        int sz = str.length();
        char[] chs = new char[sz];
        int count = 0;
        for (int i = 0; i < sz; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                chs[count++] = str.charAt(i);
            }
        }
        if (count == sz) {
            return str;
        }
        return new String(chs, 0, count);
    }
docs: <p>Deletes all whitespaces from a String as defined by
  {@link Character#isWhitespace(char)}.</p>
  
  <pre>
  GosuStringUtil.deleteWhitespace(null)         = null
  GosuStringUtil.deleteWhitespace("")           = ""
  GosuStringUtil.deleteWhitespace("abc")        = "abc"
  GosuStringUtil.deleteWhitespace("   ab  c  ") = "abc"
  </pre>
  
  @param str  the String to delete whitespace from, may be null
  @return the String without whitespaces, <code>null</code> if null String input