Sign up for Free !!
World's first open source developer community with
Ticketing System
looking for a string.contains or string.indexof method in Python.
string.contains
string.indexof
want to do:
if not somestring.contains("blah"): continue
In [1]: s = 'python' In [2]: s.startswith('pyt') Out[2]: True In [3]: s.find('ho') Out[3]: 3
AsYou can use the in operator:
in
if "blah" not in somestring:
somestring:
continue
Please Login/Register to write your answer !!!