I'm looking for a string.contains
or string.indexof
method in Python.
I want to do:
if not somestring.contains("blah"):
continue
containspythonstringsubstring
I'm looking for a string.contains
or string.indexof
method in Python.
I want to do:
if not somestring.contains("blah"):
continue
Best Answer
Use the
in
operator:Note: This is case-sensitive.