python的字符串内建函数12
python中string模块有很多字符串的方法,下面简单列几个方法。
工具/原料
python
电脑
字符串内建函数:
1、string.rstrip():删除字符串末尾的空格。
2、string.split(str):以str为分隔符切片字符串。
3、string.split(str, num):以str为分隔符切片字符串,如果num有值,则仅分隔num+1个子字符串。
4、string.swapcase():翻转字符串中的大小写。
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:36
阅读量:46
阅读量:59
阅读量:49
阅读量:36