public
String toUpperCase(Locale locale)
Converts
all of the characters in this String to upper case using the rules of
the given Locale.
import java.util.Locale; class StringToUpperCaseLocale{ public static void main(String args[]){ String str = "eFgHiJkLm"; String upper1 = str.toUpperCase(Locale.TAIWAN); String upper2 = str.toUpperCase(Locale.getDefault()); System.out.println("str = " + str); System.out.println("upper1 = " + upper1); System.out.println("upper2 = " + upper2); } }
Output
str = eFgHiJkLm upper1 = EFGHIJKLM upper2 = EFGHIJKLM
No comments:
Post a Comment