I'm looking for a
string.indexof method in Python.
I want to do:
if not somestring.contains("blah"): continue
If it's just a substring search you can use
s = "This be a string" if s.find("is") == -1: print "No 'is' here!" else: print "Found 'is' in the string."
It would print
Found 'is' in the string. Similarly,
if "is" in s: would evaluate to
True. This may or may not be what you want.