To use String.Contains in Python you can use the IN operator.
testString = "Hello World 2015"
if "World" not in testString:
print("World is not in String")
else:
print("World is in String")
All the Code Snippets and Samples you need
To use String.Contains in Python you can use the IN operator.
testString = "Hello World 2015"
if "World" not in testString:
print("World is not in String")
else:
print("World is in String")
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to do a string contains in #Python http://t.co/Wgx9onYNad #coding #codesnippets #codeacademy #dev #developers #dev…
RT @CodeSnippetsNET: How to do a string contains in #Python http://t.co/Wgx9onYNad #coding #codesnippets #codeacademy #dev #developers #dev…