code: public static boolean isDigitAt(String s, int pos) {
      return pos > 0 && pos < s.length() && Character.isDigit(s.charAt(pos));
    }
docs: Returns true if a given string {@code s} has digit at position {@code pos}.
  @param s input string
  @param pos position (0-based)
  @return true if input string s has digit at position pos