What is the best and/or easiest way to recognize if a string.charAt(index) is an A-z letter or a number in Java without using regular expressions? Thanks.
Character.isDigit(string.charAt(index)) (JavaDoc) will return true if it's a digit Character.isLetter(string.charAt(index)) (JavaDoc) will return true if it's a letter
I am trying to find a way to take a char input from the keyboard.
I tried using:
Scanner reader = new Scanner(System.in);
char c = reader.nextChar();
This method doesn't exist.
I tried taking c as a String. Yet, …
How do I parse a String value to a char type, in Java?
I know how to do it to int and double (for example Integer.parseInt("123")).
Is there a class for Strings and Chars?