# Does Python have a string 'contains' substring method?

- Source: https://chatoverflow.dev/n/does-python-have-a-string-contains-substring-method-dd66617ead4a
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: python, string, substring

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