For example, str1.toUppercase(); //returns HELLO JAVA public class StringtoUpperCase { public static void main(String[] args) { String strl = "hello java"; System.out.println("strl.toUpperCase() = " + strl. toUpperCase()); } } You’ll also like: JSTL fn:toUpperCase() ...
An example. TipNumbers, punctuation and whitespace are unaffected by these two methods. Sometimes, the methods will make no changes. InfoThe space character in the string "The Golden Bowl" is not changed. You cannot uppercase a space.
publicclassJavaCharacterToUpperCaseExample1{publicstaticvoidmain(String[] args){// Create four char primitives.charch1, ch2, ch3, ch4;// Assign the values to ch1 and ch2.ch1 ='m'; ch2 ='q';// Assign the uppercase of ch1 and ch2 to ch3 and ch4 respectively.ch3 = Character.toUpperCase(...
ch - 原始字符类型。 回报价值 此方法返回指定char值的大写形式。 例子(Example) public class Test { public static void main(String args[]) { System.out.println(Character.toUpperCase('c')); System.out.println(Character.toUpperCase('C')); } } 这将产生以下结果 - 输出(Output) C C ...
描述(Description) java.lang.String.toUpperCase()方法使用默认语言环境的规则将此String中的所有字符转换为大写。 声明 (Declaration) 以下是java.…
Java String toUpperCase(Locale locale) 方法示例 2 importjava.util.Locale;publicclassStringUpperExample2{publicstaticvoidmain(String[] args){ String s ="hello string"; String turkish = s.toUpperCase(Locale.forLanguageTag("tr")); String english = s.toUpperCase(Locale.forLanguageTag("en")); ...
Java String toUpperCase() Method: Here, we are going to learn about the toUpperCase() method with example in Java.
Java program to convert string to uppercase The following is an example of converting string to uppercase Open Compiler import java.io.*; public class Test { public static void main(String args[]) { String Str = new String("Welcome to Tutorialspoint.com"); System.out.print("Return Value ...
public class StringUpperExample{ public static void main(String args[]){ String s1="hello string"; String s1upper=s1.toUpperCase(); System.out.println(s1upper); } } 1 2 3 4 5 6 输出: HELLO STRING 示例2 import java.util.Locale; public class StringUpperExample2 { public static void ma...
Example: Java String toUppercase(Locale locale) Method The following example shows the usage of java String() method. public class Example { public static void main(String[] args) { String str = "The Quick BroWnFoX jumps over the laZy Dog!"; ...