The method determines whether the specified char value is a white space which includes space, tab or new line.
boolean isWhitespace(char ch)
Here is the detail of parameters:
Primitive character type
Returns true if passed character is really a white space.
public class Test{ public static void main(String args[]){ System.out.println( Character.isWhitespace('c')); System.out.println( Character.isWhitespace(' ')); System.out.println( Character.isWhitespace('\n')); System.out.println( Character.isWhitespace('\t')); } }
This produces following result:
false true true true
Advertisement