WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Java isWhitespace() Method


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

Syntex

boolean isWhitespace(char ch)

Parameters

what is mean of ch?
ch − Primitive character type.

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'));
         System.out.println(Character.isWhitespace('2'));
   }
}

Output
 false
true
true
true
false

Run example »