将字符串转成大写字母,这等效于调用toUpperCase(Locale.getDefault())。
public String toUpperCase()
import java.io.*; public class Test { public static void main(String args[]) { String Str=new String("Welcome to Learnfk.com"); System.out.print("返回值 :" ); System.out.println(Str.toUpperCase() ); } }
这将产生以下输出-
链接:https://www.learnfk.comhttps://www.learnfk.com/java/java-string-touppercase.html
来源:LearnFk无涯教程网
返回值 :WELCOME TO LEARNFK.COM
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)