Java String toLowerCase function – JavaDream

Home / Java String toLowerCase function – JavaDream

Java toLowerCase function of string converts the given string into lower case. Return type of this function is String.

For Example if i have a string like “I Like Java Programming Language” and i want to convert this string into lower case then i will use toLowerCase function of String.

package javadream;

import java.util.Locale;

public class JavaDream {

	public static void main(String[] args) {
		 String str = "I Like Java Programming Language";
		 String lowerCase = str.toLowerCase();
		 System.out.println(lowerCase);
	}
}

Output

tolowercase java

As toLowerCase function java also provides toUpperCase function. This function is used to convert given string into upper case.

toUpperCase Function

package javadream;

import java.util.Locale;

public class JavaDream {

	public static void main(String[] args) {
		 String str = "I Like Java Programming Language";
		 String upperCase = str.toUpperCase();
		 System.out.println(upperCase);
	}
}

Output

You may also like

CASE Statement in MySQL Example

Spring Boot Complete Tutorial from Zero to Hero

Refrence:

Java Official Documents

Help Others, Please Share

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *