1import java.util.Locale;
2public class StringToLowerCaseMethodExample
3{
4 public static void main(String[] args)
5 {
6 String str = "HELLOWORLD sTrInG";
7 String strEnglish = str.toLowerCase(Locale.ENGLISH);
8 System.out.println(strEnglish);
9 String strTurkish = str.toLowerCase(Locale.forLanguageTag("tr"));
10 System.out.println(strTurkish);
11 }
12}
13
14
15
1import java.util.*;
2public class StringToLowerCaseMethodExample
3{
4 public static void main(String[] args)
5 {
6 String str = "HELLOWORLD CORE jAva";
7 String strLower = str.toLowerCase();
8 System.out.println(strLower);
9 }
10}
11
12
13
1/* to find the lowercase or uppercase of a string,
2* we just .toLowerCase() or .toUpperCase()
3*/
4
5public class CaseDemonstration {
6 public static void main(String[] args) {
7
8 String testString = "THIS IS AN EXAMPLE OF A STRING";
9 String testStringLower = testString.toLowerCase(); // make a string lowercase
10 System.out.println(testStringLower); // "this is an example of a string"
11 String testStringUpper = testStringLower.toUpperCase(); // make it upper again
12 System.out.println(testStringUpper); // "THIS IS AN EXAMPLE OF A STRING"
13
14 }
15}