String.to_uppercase
String.to_uppercase
功能
把字符串转换为大写。
语法
string.to_uppercase()
参数
无参数。
返回值
| 类型 | 说明 |
|---|---|
| String | 返回大写后的新字符串。 |
示例
text = 'Hello BT' result = text.to_uppercase() // 输出:HELLO BT print result
注意事项
- 使用 Rust 字符串大写转换规则。
把字符串转换为大写。
string.to_uppercase()
无参数。
| 类型 | 说明 |
|---|---|
| String | 返回大写后的新字符串。 |
text = 'Hello BT' result = text.to_uppercase() // 输出:HELLO BT print result