sStr1 = 'abcdefg' sStr2 = 'cde' print sStr1.find(sStr2)
输出 2
意思是在sStr1字符里的第2位置找到了包含cde字符的字段
python查找字符串 函数find() 用法
猜你喜欢
转载自www.cnblogs.com/kaibindirver/p/9689805.html
今日推荐
周排行