Java Character toLowerCase() Method

The toLowerCase(char ch) method of Character class converts the given character argument to the lowercase using a case mapping information which is provided by the Unicode Data file. It should be noted that Character.isLowerCase(Character.toLowerCase(ch)) may not always return true for some characters like symbols or ideographs.

In actual, the String.toLowerCase() can be used to map the characters into lowercase. There are various benefits of String case mapping as compared to Character case mapping. String case mapping can be used to perform local-sensitive mappings, context-sensitive mappings whereas the Character case mapping cannot be used.

Syntax

Parameter

ch: It is the character that needs to be tested.

Return Value

The toLowerCase(char ch)method returns a lowercase of the given character if any. Otherwise, this method returns the character itself.

Example 1

Output:

The lowercase for the first character 'F' is given as: f
The lowercase for the second character 'n' is given as: n

Example 2

Output:

Enter the first input:T
The character T is converted in the lowercase as: t
Enter the second input:i
The character i is converted in the lowercase as: i

Java Character toLowerCase()Method

The toLowerCase(int codePoint) method of Character class converts the given character (Unicode code point) argument to the lowercase using a case mapping information which is provided by the Unicode Data file.

It should be noted that Character.isLowerCase(Character.toLowerCase(codePoint)) may not always return true for some characters like symbols or ideographs.

Syntax

Parameter

The above method requires only one parameter:

a.)The codePoint(Unicode code point) which is the character that needs to be tested.

Return Value

The toLowerCase(int codePoint)method returns a lowercase of the given character if any. Otherwise, this method returns the character itself.

Example 1

Output:

The character 'W' can be represented in lower case as w
The character 'Z' can be represented in lower case as z

Example 2

Output:

The character 'y' can be represented in lower case as y
The character '_' can be represented in lower case as _