se o sub-texto não estiver no python de texto
fullstring = "StackAbuse"
substring = "tack"
if fullstring.find(substring) != -1:
print "Found!"
else:
print "Not found!"
Como posso verificar se um texto contém uma palavra específica?
$a = 'Hello world?';
if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
echo 'true';
}
procurar o texto em python de texto
>>> str = "Messi is the best soccer player"
>>> "soccer" in str
True
>>> "football" in str
False