Trusted answers to developer questions

What is Character.isLetter() in JAVA?

Get Started With Data Science

Learn the fundamentals of Data Science with this free course. Future-proof your career by adding Data Science skills to your toolkit — or prepare to land a job in AI, Machine Learning, or Data Analysis.

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
Did you find this helpful?