is Identifier Start - Java java.lang

Java examples for java.lang:Assert

Description

is Identifier Start

Demo Code


//package com.java2s;

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

    public static boolean isIdentifierStart(char c) {
        return isAsciiAlphabet(c) || c == '_';
    }

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

Related Tutorials