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.


/*w ww  . j a  v  a2  s.c o m*/
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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable