Answers for "how to find whether the word exists in the string in python"

PHP
2

if word exist in string

$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
Posted by: Guest on April-28-2020
71

how to check if there is a word in a string in python

>>> str = "Messi is the best soccer player"
>>> "soccer" in str
True
>>> "football" in str
False
Posted by: Guest on December-09-2019

Code answers related to "how to find whether the word exists in the string in python"

Browse Popular Code Answers by Language