|
Is White Space
The following example shows how to use Character.isWhitespace() API.
|
package com.bethecoder.tutorials.core.character;
public class CharIsWhiteSpace {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(Character.isWhitespace(' '));
System.out.println(Character.isWhitespace('\n'));
System.out.println(Character.isWhitespace('\t'));
System.out.println(Character.isWhitespace('\f'));
System.out.println(Character.isWhitespace('\r'));
System.out.println(Character.isWhitespace('A'));
System.out.println(Character.isWhitespace('9'));
}
}
|
| |
It gives the following output,
true
true
true
true
true
false
false
|
|