Java toUpperCase() Method
The toUpperCase() method converts the lowercase characters of the string to uppercase.
Syntax
public String toUpperCase()
或
public String toUpperCase(Locale locale)
Parameters
-
None
Return Value
The string after the characters are converted to uppercase.
Example
public class Test {
public static void main(String args[]) {
String Str = new String("www.runoob.com");
System.out.print("返回值 :" );
System.out.println( Str.toUpperCase() );
}
}
The execution result of the above program is:
返回值 :WWW.RUNOOB.COM
Java String class