docs: public static int digitAt(String s, int pos) {
      int c = s.charAt(pos) - '0';
      if (c < 0 || c > 9) {
        throw new NumberFormatException("Input string: \"" + s + "\", position: " + pos);
      }
      return c;
    }