Python 3 字符串 upper( ) 方法
Python 3.8.5
语法格式:
str.upper()
描述:
- 创建一个字符串将原字符串中区分大小写的字符全部转换为大写。
- 请注意如果 str 包含不区分大小写的字符或者如果结果字符的 Unicode 类别不是 "Lu"(Letter, uppercase)而是 "Lt"(Letter, titlecase)则 str.upper( ) 或 str.isupper( ) 有可能为 False。
参数说明:
- 无。
返回值:
- 返回转换后的字符串。
示例:
>>> str = "this is string example from runoob....wow!!!"
>>> print ("str.upper() : ", str.upper())
str.upper() : THIS IS STRING EXAMPLE FROM RUNOOB....WOW!!!