Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

java
isletter
communitycreator

What is Character.isLetter() in JAVA?

harris910

The isLetter() function returns true if the character sent as a parameter is letter; otherwise, it returns false.

Figure 1 shows a visual representation of the isLetter() function.

Figure 1: Visual representation of the isLetter() function

Syntax

boolean isLetter(char character)

Parameter

The isLetter() function takes the character as a parameter.

Return value

The isLetter() function returns true if the character sent as a parameter is letter; otherwise, it returns false.

Code

class JAVA {
    public static void main( String args[] ) {
        //simple letter
        System.out.println("Character.isLetter('E'):");
        System.out.println(Character.isLetter('E'));

        //other character
        System.out.println("Character.isLetter('*'):");
        System.out.println(Character.isLetter('*'));

        //digit character
        System.out.println("Character.isLetter('5'):");
        System.out.println(Character.isLetter('5'));

    }
}

RELATED TAGS

java
isletter
communitycreator
RELATED COURSES

View all Courses

Keep Exploring