code: static int findNonWhitespace(String sb, int offset) {
          int result;
          for (result = offset; result < sb.length(); result ++) {
              if (!Character.isWhitespace(sb.charAt(result))) {
                  break;
              }
          }
          return result;
      }
docs: Find the first non whitespace
  @return the rank of the first non whitespace