sna*_*ile 288 python string substring
我有两个字符串,我想检查第一个是否是另一个的子字符串.Python有这样的内置功能吗?
And*_*are 469
尝试使用in这样:
in
>>> x = 'hello' >>> y = 'll' >>> y in x True
Mar*_*one 48
尝试
isSubstring = first in theOther
Dan*_*ner 35
string.find("substring")会帮助你.-1没有子字符串时返回此函数.
string.find("substring")
-1
归档时间:
14 年,7 月 前
查看次数:
412834 次
最近记录:
7 年,11 月 前