Chrome Extension

Python - String , Check If Word Is In string

if word in mystring: 
   print ('success')

# or

if 'seek' in 'those who seek shall find':
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

but keep in mind that this matches a sequence of characters, not necessarily a whole word - for example, 'word' in 'swordsmith' is True. If you only want to match whole words, you ought to use regular expressions:

Was this helpful?
Join Devsheet Ask a Question