code: public static String removeAllWhitespaces(final String string) {
          if (string == null || string.length() == 0) {
              return string;
          }
          final int originalSize = string.length();
          final char[] charArray = new char[originalSize];
          int charCount = 0;
          for (int i = 0; i < originalSize; i++) {
              final char currentChar = string.charAt(i);
              if (!Character.isWhitespace(currentChar)) {
                  charArray[charCount++] = currentChar;
              }
          }
          if (charCount == originalSize) {
              return string;
          }
          return new String(charArray, 0, charCount);
      }
docs: <p>
  Internal utility method. DO NOT use this method directly.
  </p>
  
  @param string text from which all whitespace will be removed
  @return the text without whitespace