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