Check if a Character is Lowercase or not in Java
Read Also:
Check if a Character is Lowercase or not in Java
1. Using Character class isLowerCase() method
According to , the Character.isLowerCase() method can be used to determine if the specified character is a lowercase character.
The following are examples of lowercase characters:
a b c d e f g h i j k l m n o p q r s t u v w x y z
'\u00DF' '\u00E0' '\u00E1' '\u00E2' '\u00E3' '\u00E4' '\u00E5' '\u00E6'
'\u00E7' '\u00E8' '\u00E9' '\u00EA' '\u00EB' '\u00EC' '\u00ED' '\u00EE'
'\u00EF' '\u00F0' '\u00F1' '\u00F2' '\u00F3' '\u00F4' '\u00F5' '\u00F6'
'\u00F8' '\u00F9' '\u00FA' '\u00FB' '\u00FC' '\u00FD' '\u00FE' '\u00FF'
Note:
Character.isLowerCase() method cannot handle
.
Java Program
public class CheckCharacterLowercase { public static void main(String args[]) { char ch = 'a'; if(Character.isLowerCase(ch)) { System.out.println("Given character is Lowercase"); } else { System.out.println("Given character is NOT Lowercase"); } } }
Output:
Given character is Lowercase
That's all for today. Please mention in the comments if you know any other way of checking if a character is lowercase or not in Java.