python中的swapcase

it2026-05-01  10

python中的swapcase

swapcase()将字符串中的字母小写变大写、大写变小写,举个例子:

1 a = "hELLO wORLD" 2 a1 = a.swapcase() 3 print(a1)

输出结果:

Hello World posted on 2019-04-09 10:09 恒笛 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/xwqhl/p/10675188.html

相关资源:在Python中使用swapCase()方法转换大小写的教程
最新回复(0)