toUpperCase()
将此String中的所有字符转换为大写。
语法 (Syntax)
String toUpperCase()
参数 (Parameters)
没有
返回值 (Return Value)
大写的修改后的字符串。
例子 (Example)
以下是此方法的使用示例 -
class Example {
static void main(String[] args) {
String a = "HelloWorld";
println(a.toUpperCase());
}
}
当我们运行上述程序时,我们将得到以下结果 -
HELLOWORLD