Indicates if the given character is a control character. - Java java.lang

Java examples for java.lang:char

Description

Indicates if the given character is a control character.

Demo Code


//package com.java2s;

public class Main {
    /**/*from www.  j  a  v  a2s. c om*/
     * Indicates if the given character is a control character.
     * 
     * @param character
     *            The character to test.
     * @return True if the given character is a control character.
     */
    public static boolean isControlChar(int character) {
        return ((character >= 0) && (character <= 31))
                || (character == 127);
    }
}

Related Tutorials