Answers for "how to check if string contains a word in python"

PHP
2

How do I check if a string contains a specific word?

$a = 'Hello world?';

if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
    echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
    echo 'true';
}
Posted by: Guest on May-18-2020
0

check if string equals string in list python

if any(x in paid[j] for x in d):
  # do stuff
Posted by: Guest on November-21-2020

Code answers related to "how to check if string contains a word in python"

Browse Popular Code Answers by Language