python 字符串是否包含某个子字符串

方法如下:以后再整理

if str1 in str2:

  包含的话,True

if str1.find(str2)>=0:

  包含的话,返回第一次出现的位置,没有的话为负数

https://www.cnblogs.com/wq242424/p/6524697.html

posted @ 2018-01-19 16:27  beforeluck  阅读(182195)  评论(0)    收藏  举报