docs: public static String trim(String string)
    {
      if(string == null) {
        return null;
      }
      int length = string.length();
      int beginIndex = 0;
      for(; beginIndex < length; ++beginIndex) {
        if(!Character.isWhitespace(string.charAt(beginIndex))) break;
      }
      int endIndex = length - 1;
      for(; endIndex >= 0; --endIndex) {
        if(!Character.isWhitespace(string.charAt(endIndex))) break;
      }
      return string.substring(beginIndex, endIndex + 1);
    }