描述

Python upper() 方法将字符串中的小写字母转为大写字母。

语法

upper() 方法语法:

S.upper()

参数

  • 无。

返回值

返回小写字母转为大写字母的字符串。

实例

以下实例展示了 upper() 方法的使用方法:

#!/usr/bin/python3

S = "this is string example from runoob....wow!!!";

print ("S.upper() : ", S.upper())

以上实例输出结果如下:

S.upper() :  THIS IS STRING EXAMPLE FROM RUNOOB....WOW!!!

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2021-06-22
  • 2021-05-20
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案