This book presents a broad overview of numerical methods and software for students and professionals in computationally oriented disciplines who need to solve mathematical prob-lems. It is not a traditional numerical analysis text in that it contain
本文实例讲述了python判断字符串是否包含子字符串的方法。分享给大家供大家参考。具体如下:
python的string对象没有contains方法,不用使用string.contains的方法判断是否包含子字符串,但是python有更简单的方法来替换contains函数。
方法1:使用 in 方法实现contains的功能:
site = '//www.jb51.net/'
if "jb51" in site:
print('site contains jb51')
输出结果:sit