rank vote view answer url
9 3072 2877536 14 url

Python中有检查字符串包含的方法吗?

我正在找string.contains或者string.indexof方法.

我希望:

if not somestring.contains("blah"):
   continue

你可以用in啊:

if not "blah" in somestring: continue

或者:

if "blah" not in somestring: continue
Copyright © taizilongxu 2018 all right reserved,powered by Gitbook该文件修订时间: 2018-10-17 17:33:54

results matching ""

    No results matching ""