内容简介:Python swapcase() 方法用于对字符串的大小写字母进行转换。
描述
Python swapcase() 方法用于对字符串的大小写字母进行转换。
语法
swapcase()方法语法:
str.swapcase();
参数
- NA。
返回值
返回大小写字母转换后生成的新字符串。
实例
以下实例展示了swapcase()函数的使用方法:
#!/usr/bin/python str = "this is string example....wow!!!"; print str.swapcase(); str = "THIS IS STRING EXAMPLE....WOW!!!"; print str.swapcase();
以上实例输出结果如下:
this is string example....wow!!!
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Introduction to Programming in Java
Robert Sedgewick、Kevin Wayne / Addison-Wesley / 2007-7-27 / USD 89.00
By emphasizing the application of computer programming not only in success stories in the software industry but also in familiar scenarios in physical and biological science, engineering, and appli......一起来看看 《Introduction to Programming in Java》 这本书的介绍吧!