前言
定义和用法toUpperCase() 方法将字符串转换为大写字母。注意:toLowerCase() 方法将字符串转换为小写字母。实例将字符串转换为大写和小写字母
定义和用法
toUpperCase() 方法将字符串转换为大写字母。
注意:toLowerCase() 方法将字符串转换为小写字母。
实例
将字符串转换为大写和小写字母:
String txt = "Hello World"; System.out.println(txt.toUpperCase()); System.out.println(txt.toLowerCase());
运行实例 »
点击 "运行实例" 按钮查看在线实例
语法
public String toUpperCase()
运行实例 »
点击 "运行实例" 按钮查看在线实例
参数
无参数。
技术细节
| 返回: |
String 值,表示转换为大写的新字符串。 |
|---|
