I'm looking for a string.contains
or string.indexof
method in Python.
I want to do:
if not somestring.contains("blah"):
continue
转载于:https://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method
I'm looking for a string.contains
or string.indexof
method in Python.
I want to do:
if not somestring.contains("blah"):
continue
转载于:https://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method
You can use the in
operator:
if "blah" not in somestring:
continue