Java Character toLowerCase() Method
Example
Convert characters to lowercase:
public class Main {
public static void main(String[] args) {
System.out.println(Character.toLowerCase('A'));
System.out.println(Character.toLowerCase('b'));
System.out.println(Character.toLowerCase('5'));
}
}
Definition and Usage
The toLowerCase() method returns the lowercase version of a character.
If the character is already lowercase, or is not a letter (like a digit), the method returns the same character.
Tip: Use the String toLowerCase() method to convert a whole string to lowercase.
Syntax
One of the following:
public static char toLowerCase(char ch)
public static int toLowerCase(int codePoint)
Most programs use the first version, with a char. The second version takes the character as a code point (the number that Unicode gives each character), as an int.
Parameter Values
| Parameter | Description |
|---|---|
| ch | Required. The character to convert. |
| codePoint | Required. The code point of the character to convert. |
Technical Details
| Returns: | The lowercase character. The first version returns a char, the second version returns a code point as an int. |
|---|
Related Pages
❮ Character Methods