Indicates if the given character is in ASCII range. - Java java.lang

Java examples for java.lang:char

Description

Indicates if the given character is in ASCII range.

Demo Code


//package com.java2s;

public class Main {
    /**/*from   w  w w . ja  va2 s  .co  m*/
     * Indicates if the given character is in ASCII range.
     * 
     * @param character
     *            The character to test.
     * @return True if the given character is in ASCII range.
     */
    public static boolean isAsciiChar(int character) {
        return (character >= 0) && (character <= 127);
    }
}

Related Tutorials