python string

 

 

 

(1)常用函数
string.find("abc") ## 返回字符串"abc"在string中的起始序号
string.replace("abc", "ab")
string.count("d") ##统计指定字符(串)个数
string.isalpha()
string.isplace()
string.isdigit()
str.startswith(('x', 'yz'))
str.endswith(('x', 'yz'))

 

posted on 2016-03-16 20:48  qmzp  阅读(139)  评论(0编辑  收藏  举报

导航