WebLinuxStudy

导航

 

python判断字符串中是否包含子字符串

s = '1234问沃尔沃434'
if s.find('沃尔沃') != -1:
    print('存在')
else:
    print('不存在')

 

posted on 2019-08-29 16:25  WebLinuxStudy  阅读(7177)  评论(0编辑  收藏  举报