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