|
Is Letter Or Digit
The following example shows how to use Character.isLetterOrDigit() API.
|
package com.bethecoder.tutorials.core.character;
public class CharIsLetterOrDigit {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(Character.isLetterOrDigit('a'));
System.out.println(Character.isLetterOrDigit('z'));
System.out.println(Character.isLetterOrDigit('A'));
System.out.println(Character.isLetterOrDigit('Z'));
System.out.println(Character.isLetterOrDigit(' '));
System.out.println(Character.isLetterOrDigit('\n'));
System.out.println(Character.isLetterOrDigit('\t'));
System.out.println(Character.isLetterOrDigit('0'));
System.out.println(Character.isLetterOrDigit('6'));
}
}
|
| |
It gives the following output,
true
true
true
true
false
false
false
true
true
|
|