tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Java > Core > Character > Is White Space

Is White Space 

The following example shows how to use Character.isWhitespace() API.

File Name  :  
com/bethecoder/tutorials/core/character/CharIsWhiteSpace.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
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



 
  


  
bl  br