【python】python基本语法
字符串
字符串是否包含子字符串
两种方法:[find()] [in]/[not in]
// 方法一
if string1.find(string2):
print("found string2 in string1")
// 方法二
if string2 in string1:
print("found string2 in string1")
两种方法:[find()] [in]/[not in]
// 方法一
if string1.find(string2):
print("found string2 in string1")
// 方法二
if string2 in string1:
print("found string2 in string1")