code: public static String removeNumericSuffix(String name) {
      int i = name.length();
      while (--i >= 0) {
        char ch = name.charAt(i);
        if (ch < '0' || ch > '9') break;
      }
      return name.substring(0, i + 1);
    }
docs: Helper function which strips the provided name from any numeric suffix in the end.
  Equivalent to <code>name.rstrip("0123456789")</code> in Python.