在 Java 中转换为大写。
此方法有两个变体。第一个变体使用给定语言环境的规则将此 String 中的所有字符转换为大写。这等效于调用 toUpperCase(Locale.getDefault())。
第二个变体采用语言环境作为参数,该语言环境将用于在大写转换中。
示例
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 :");
System.out.println(Str.toUpperCase());
}
}输出
Return Value :WELCOME TO TUTORIALSPOINT.COM
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP