java 字符串转换为大写
Java中可以使用toUpperCase()方法将字符串转换为大写。
示例代码如下:
String str = "hello world";
String upperCaseStr = str.toUpperCase();
System.out.println(upperCaseStr);
运行以上代码,输出结果为:
HELLO WORLD
原文地址: http://www.cveoy.top/t/topic/h8bm 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
Java中可以使用toUpperCase()方法将字符串转换为大写。
示例代码如下:
String str = "hello world";
String upperCaseStr = str.toUpperCase();
System.out.println(upperCaseStr);
运行以上代码,输出结果为:
HELLO WORLD
原文地址: http://www.cveoy.top/t/topic/h8bm 著作权归作者所有。请勿转载和采集!