Java Data Type Tutorial - Java Character.isWhitespace(char ch)








Syntax

Character.isWhitespace(char ch) has the following syntax.

public static boolean isWhitespace(char ch)

Example

In the following code shows how to use Character.isWhitespace(char ch) method.


public class Main{
  public static void main(String[] argv){   
    System.out.println("is white space:"+Character.isWhitespace('a'));      
    System.out.println("is white space:"+Character.isWhitespace('\n'));      
    System.out.println("is white space:"+Character.isWhitespace('\t'));      
  }
}

The code above generates the following result.