is letter Whitespace - Java java.lang

Java examples for java.lang:char

Description

is letter Whitespace

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        char ch = 'a';
        System.out.println(isWhitespace(ch));
    }/*from  w ww. j a va 2 s  .  c o  m*/

    public static boolean isWhitespace(char ch) {

        return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\f'
                || ch == '\r';
    }
}

Related Tutorials