# 判斷是否包含子字串
s = 'this is a string'
if 'string' in s:
print('s include string')
# 尋找子字串起始位置
pos = s.find('string')
print(str(pos))
# 計算子字串出現次算
num = s.count('string')
# 判斷是否包含子字串
s = 'this is a string'
if 'string' in s:
print('s include string')
# 尋找子字串起始位置
pos = s.find('string')
print(str(pos))
# 計算子字串出現次算
num = s.count('string')