比较长的字符串中,是否含有特定字符串_repeat

发布时间:2026/7/12 20:34:28

比较长的字符串中,是否含有特定字符串_repeat 比较长的字符串中是否含有特定字符串_repeat#include string.h const char *long_str This is a very long string containing some keywords; const char *needle keywords; if (strstr(long_str, needle) ! NULL) { // 存在 keywords字符串 printf(found it\n); } else { // 不存在 keywords字符串 printf(not found\n); }

相关新闻