The java.lang.String.toLowerCase(Locale locale) method converts all of the characters in this String to lower case using the rules of the given Locale.
DeclarationFollowing is the declaration for java.lang.String.toLowerCase() method
public String toLowerCase(Locale locale)Parameters
locale − use the case transformation rules for this locale.
Return ValueThis method returns the String, converted to lowercase.
ExceptionNA
ExampleThe following example shows the usage of java.lang.String.toLowerCase() method.
package com.tutorialspoint; import java.lang.*; import java.util.*; public class StringDemo { public static void main(String[] args) { String str1 = "Self Learning Center"; // using the default system Locale Locale defloc = Locale.getDefault(); // converts all upper case letters in to lower case letters System.out.println("string value = " + str1.toLowerCase(defloc)); str1 = "WWW.PHOTOFUNTOOS.COM"; System.out.println("string value = " + str1.toLowerCase(defloc)); } }
Let us compile and run the above program, this will produce the following result −
string value = self learning center string value = www.photofuntoos.com
java_lang_string.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4