python字符串内置函数汇总

1.capitalize 第一个单词首字母大写

2.title 每个单词首字母大写

3.upper 每个字母变大写

4.lower 每个字母变小写

5.len() 字符串长度

6.format() 格式化  print("{}".format('aa'))

7.replace替换 str.replace

8.find() 字符串查找 str.find() 返回整型

9.split 分割返回列 str=“www.96net.com.cn” str.split('.') 返回 ['www','96net','com,'cn'']

10.join()  列表链接字符串 (":").join(str)

11.max() 最大值

12.min() 最小值

13.index() 字母首次出现的位置索引

 

posted @ 2017-11-16 13:31  学无边涯  阅读(297)  评论(0编辑  收藏  举报