Example in python:
>>> a="Sweet potato"
>>> "potato" in a
True
I thought it might be strcmp
, but strcmp
must be identical match, no?
Example in python:
>>> a="Sweet potato"
>>> "potato" in a
True
I thought it might be strcmp
, but strcmp
must be identical match, no?
strcmp
is used to determined if two string are identical.
if you want to find if a string contain a sub string there are severel way. a very good one is what Alter Mann wrote:
if (strstr(str, "potato")) puts("True");