【发布时间】:2014-11-11 09:31:41
【问题描述】:
python中的示例:
>>> a="Sweet potato"
>>> "potato" in a
True
我认为可能是strcmp,但strcmp 必须是相同的匹配项,不是吗?
【问题讨论】:
-
C 有many string functions,您可能想探索一下。
-
if (strstr(str, "potato")) puts("True"); -
Google 第一次点击 ^^ above 是适当的 SO 问题/答案。
-
子字符串不会出现在我的头上>
标签: c substring string-comparison