This example demonstrates how to change the string’s Uppercase into Lowercare by toLowerCase method.
Source Code
package com.beginner.examples;
public class StringToLowerCase {
public static void main(String[] args) {
String string = "HELLO WORLD.";
/*
* To change the case of string to lower case use toLowerCase method of String.
*/
String stringResult = string.toLowerCase();
System.out.println("Before changing to lowercase , String is : " + string);
System.out.println("After changing to lowercase , String is : " + stringResult);
}
}
Output:
Before changing to lowercase , String is : HELLO WORLD.
After changing to lowercase , String is : hello world.