Answers for "see if string is present in string"

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
10

python check if string in string

if "blah" not in somestring: 
    continue
Posted by: Guest on July-23-2020

Code answers related to "see if string is present in string"

Browse Popular Code Answers by Language