Monday 23 June 2014

toLowerCase (Locale locale)

public String toLowerCase(Locale locale)
Converts all of the characters in this String to lower case using the rules of the given Locale.

import java.util.Locale;
class StringToLowerLocale{
 public static void main(String args[]){
  String str = "eFgHiJkLm";
  String lower1 = str.toLowerCase(Locale.TAIWAN);
  String lower2 = str.toLowerCase(Locale.getDefault());
  
  System.out.println("str = " + str);
  System.out.println("lower1 = " + lower1);
  System.out.println("lower2 = " + lower2);
 } 
}

Output
str = eFgHiJkLm
lower1 = efghijklm
lower2 = efghijklm



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment