2018-11-19
阅读量:
1104
find
方法find在字符串中查找子串。如果找到,就返回子串的第一个字符的索引,否则返回-1。
>>> 'With a moo-moo here, and a moo-moo there'.find('moo') 7
>>> title = "Monty Python's Flying Circus"
>>> title.find('Monty') 0
>>> title.find('Python')
6
>>> title.find('Flying') 15
>>> title.find('Zirquss')
-1
0.0000
0
1
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
0条评论
0条评论

