c - How do I check if a string is contained in another string? -
c - How do I check if a string is contained in another string? -
this question has reply here:
check substring exists in string in c 7 answersexample in python:
>>> a="sweet potato" >>> "potato" in true i thought might strcmp, strcmp must identical match, no?
strcmp used determined if 2 string identical.
if want find if string contain sub string there severel way. 1 alter mann wrote:
if (strstr(str, "potato")) puts("true"); c substring string-comparison
Comments
Post a Comment