python最新字符串学习总结

names="hello word"

len()

title()

formate 格式化

split

join

find()

replace()

startswith()

endswith()

upper()

lower()

strip() lstrip() rstrip()

index()

isdigit() 判断是否是个数字

swapcase 大小写反转

 

index与find 区别

index(“str”) str不存在时候 报错

find("str") str不存在时候 返回 -1

 

posted @ 2017-12-11 19:28  学无边涯  阅读(150)  评论(0编辑  收藏  举报