Java 实例 - 字符串小写转大写
String toUpperCase() 方法将字符串从小写转为大写
StringToUpperCaseEmp.java 文件
public class StringToUpperCaseEmp {
public static void main(String[] args) {
String str = "string facesoho";
String strUpper = str.toUpperCase();
System.out.println("原始字符串: " + str);
System.out.println("转换为大写: " + strUpper);
}
}
public static void main(String[] args) {
String str = "string facesoho";
String strUpper = str.toUpperCase();
System.out.println("原始字符串: " + str);
System.out.println("转换为大写: " + strUpper);
}
}
以上代码实例输出结果为:
原始字符串: string facesoho 转换为大写: STRING facesoho
尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题