Tutorials Point


  Java Basics
  Java Object Oriented
  Java Advanced
  Java Useful References
  Java Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Java - isWhitespace() Method


previous next AddThis Social Bookmark Button


Description:

The method determines whether the specified char value is a white space which includes space, tab or new line.

Syntax:

boolean isWhitespace(char ch)

Parameters:

Here is the detail of parameters:

  • Primitive character type

Return Value :

  • Returns true if passed character is really a white space.

Example:

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


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names