How to use string.contains in this lines:
if not somestring.contains("Hello"): continue
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ashutosh GuptaPosted Dec 5, 2019, 11:39 PM
You can use the 'in' operator or the string’s 'find' method to check if a string contains another string. in operator check exact string with destination as mentioned by Rajanikant and find operator will find that string and return the index of it, if index is -1 then it does not contains else it return no negative value.
Bhawna TutejaPosted Mar 18, 2020, 12:11 AM
lene bormaPosted Feb 11, 2020, 10:44 PM
Regular Expression
Dipa MehtaPosted Dec 6, 2019, 1:23 AM
Rajanikant HawaldarPosted Dec 5, 2019, 8:55 PM