python的字符串内建函数2
python中string模块有很多字符串的方法,下面简单列几个方法。
工具/原料
电脑
python
字符串内建函数:
1、string.count(str):返回str在string里面出现的次数。
2、string.count(str, a, b):返回指定范围内str出现的次数。
3、string.encode('UTF-8', 'strict'):以指定的编码格式编码string。
4、string.expandtabs(tabsize=?):把字符串 string 中的 tab 符号转为空格,空格长度由tabsize决定,tab符号默认的空格数是 8。
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:71
阅读量:76
阅读量:88
阅读量:75
阅读量:59