Table of Contents
You can use Character class’s toLowerCase method to convert char to lowercase in java.
Method signature
1 2 3 |
public static char toLowerCase(char ch) |
Parameters
ch is primitive character type.
Return type
return type is char. If char is already lowercase then it will return same.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
package org.arpit.java2blog; public class JavaToLowercaseMain { public static void main(String[] args) { System.out.println(Character.toLowerCase('a')); System.out.println(Character.toLowerCase('Y')); System.out.println(Character.toLowerCase('B')); System.out.println(Character.toLowerCase('Z')); } } |
When you run above program, you will get below output:
a
y
b
z
y
b
z
That’s all about how to convert char to lowercase in java.
Was this post helpful?
Let us know if this post was helpful. Feedbacks are monitored on daily basis. Please do provide feedback as that\'s the only way to improve.