Python swapcase()方法

Python 教程 · 2019-02-02 18:43:03

描述

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!!!
this is string example....wow!!!

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Java Message Service API Tutorial and Reference

Java Message Service API Tutorial and Reference

Hapner, Mark; Burridge, Rich; Sharma, Rahul / 2002-2 / $ 56.49

Java Message Service (JMS) represents a powerful solution for communicating between Java enterprise applications, software components, and legacy systems. In this authoritative tutorial and comprehens......一起来看看 《Java Message Service API Tutorial and Reference》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具