The java string toLowerCase() method converts all characters of the string into lowercase letter. There are two types of toLowerCase() method.
Signature:
public String toLowerCase(Locale loc) and public String toLowerCase() Parameter: loc- locale value to be applied. converts all the characters into lowercase using the rules of given Locale. Returns: returns string in lowercase letter.
// Java program to demonstrate // working of toLowerCase() method class Gfg { public static void main(String args[]) { String s = "Welcome! to Geeksforgeeks Planet."; // converting string s to lowercase letter String gfg1 = s.toLowerCase(); System.out.println(gfg1); } } |
chevron_right
filter_none
Output:
welcome! to geeksforgeeks planet.
// Java program to demonstrate // working of Locale class in // toLowerCase() method import java.util.Locale; class Gfg { public static void main(String args[]) { String s = "I Know YOI Bui You Don't Know ME."; // Locales with the language "tr" for TURKISH //"en" for ENGLISH is created Locale TURKISH = Locale.forLanguageTag("tr"); Locale ENGLISH = Locale.forLanguageTag("en"); // converting string s to lowercase letter // using TURKISH and ENGLISH language String gfg2 = s.toLowerCase(TURKISH); String gfg3 = s.toLowerCase(ENGLISH); System.out.println(gfg2); System.out.println(gfg3); } } |
chevron_right
filter_none
Output:
? know yo? bui you don't know me. i know yoi bui you don't know me.
Recommended Posts:
- Java String format() with examples
- Java String getChars() with examples
- Java String endsWith() with examples
- Java String concat() with examples
- Java String join() with examples
- String toString() Method in java with Examples
- Java String subSequence() method with Examples
- Split() String method in Java with examples
- ZoneOffset of(String) method in Java with Examples
- Matcher start(String) method in Java with Examples
- Matcher group(String) method in Java with Examples
- Matcher replaceAll(String) method in Java with Examples
- Matcher replaceFirst(String) method in Java with Examples
- Matcher quoteReplacement(String) method in Java with Examples
- Matcher appendReplacement(StringBuffer, String) method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



