Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Does Python have a string 'contains' substring method?
Home
Python
Does Python have a string 'contains' substring method?
+1
vote
asked
Jan 10, 2021
in
Python
by
rajeshsharma
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
#python-string
string
python
substring
contains
Python-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 10, 2021
by
rajeshsharma
You can use the in operator:
if "blah" not in somestring:
continue
...