EN
Java - convert string to lowercase
0 points
In this article, we would like to show you how to convert string to lowercase in Java.
Quick solution:
xxxxxxxxxx
1
String text = "ABCD";
2
3
String textLower = text.toLowerCase();
4
5
System.out.println(textLower); // abcd
In this example, we use String.toLowerCase()
method to convert the text
string to lowercase.
xxxxxxxxxx
1
public class Example {
2
3
public static void main(String[] args) {
4
String text = "ABCD";
5
6
// convert text to lowercase
7
String textLower = text.toLowerCase();
8
9
System.out.println(textLower); // abcd
10
}
11
}
Output:
xxxxxxxxxx
1
abcd