tolowercase local java code example

Example 1: String toLowerCase(Locale locale) method in java

import java.util.*;
public class StringToLowerCaseMethodExample
{
   public static void main(String[] args)
   {
      String str = "HELLOWORLD CORE jAva";
      String strLower = str.toLowerCase();
      System.out.println(strLower);
   }
}

Example 2: String toLowerCase(Locale locale) method in java

import java.util.Locale;
public class StringToLowerCaseMethodExample
{
   public static void main(String[] args)
   {
      String str = "HELLOWORLD sTrInG";
      String strEnglish = str.toLowerCase(Locale.ENGLISH);
      System.out.println(strEnglish);
      String strTurkish = str.toLowerCase(Locale.forLanguageTag("tr"));
      System.out.println(strTurkish);
   }
}

Tags:

Java Example