is char Letter Or Digit - Java java.lang

Java examples for java.lang:char

Description

is char Letter Or Digit

Demo Code


//package com.java2s;

public class Main {
    public static boolean isLetterOrDigit(char c) {
        return isDigit(c) || isLetter(c);
    }/*w  ww .j av a2  s  .c  o m*/

    public static boolean isDigit(char c) {
        return (c >= '0') && (c <= '9');
    }

    public static boolean isLetter(char c) {
        return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
    }
}

Related Tutorials