code: public static boolean allAlphaNumUnderscore(String string) {
          if (string == null || string.length() == 0) {
              return false;
          }
          for (int index = 0; index < string.length(); index++) {
              char ch = string.charAt(index);
              if (!isLetter(ch) && !isDigit(ch) && ch != '_') {
                  return false;
              }
          }
          return true;
      }
docs: Return true if the given string contains only letters, digits, and underscores.
  
  @param   string  String to be tested.
  @return          True if the string is not null, not empty, and contains only
  letters, digits, and underscores.