protected static Character toChar(String value){
  if (!value.startsWith("'") && !value.endsWith("'")) {
    throw new IllegalArgumentException("Character must be single quoted.");
  }
  String literal=convertString(value.substring(1,value.length() - 1));
  if (literal.length() != 1) {
    throw new IllegalArgumentException("Only one character allowed in character constants.");
  }
  return Character.valueOf(literal.charAt(0));
}

protected static Character toChar ( String value ) { if ( ! value . startsWith ( "'" ) && ! value . endsWith ( "'" ) ) { throw new IllegalArgumentException ( "Character must be single quoted." ) ; } String literal = convertString ( value . substring ( 1 , value . length ( ) - 1 ) ) ; if ( literal . length ( ) != 1 ) { throw new IllegalArgumentException ( "Only one character allowed in character constants." ) ; } return Character . valueOf ( literal . charAt ( 0 ) ) ; }
convert a character literal into a character .
