+1 vote
in Python by
Does Python have a string 'contains' substring method?

Can someone help to get string.contains or string.indexof method in Python.

I want to do:

if not somestring.contains("blah"):

   continue

1 Answer

0 votes
by
You can use the in operator:

if "blah" not in somestring:

    continue

Related questions

0 votes
asked Feb 11, 2020 in Python by rahuljain1
0 votes
asked Jan 11, 2021 in Python by SakshiSharma
...