p = StrFind(s,'Vie');
// 函数会找到 Vie 第一次出现在 "Golden Vi Global View"
...全文
672打赏收藏
C函数: 查找字串的函数叫什么
memchr , strchr 好像只能查找单一字元 我想查找一个字串 (多个字元) 的话要用什么函数呢 char *s="Golden Vi Global View"; char *p; ' 假设有一个 StrFind 函数 p = StrFind(s,'Vie'); // 函数会找到 Vie 第一次出现在 "Golden Vi Global View"
C语言里关于查找的函数:
Searching:
memchr
Locate character in block of memory (function )
strchr
Locate first occurrence of character in string (function )
strcspn
Get span until character in string (function )
strpbrk
Locate characters in string (function )
strrchr
Locate last occurrence of character in string (function )
strspn
Get span of character set in string (function )
strstr
Locate substring (function )
strtok
Split string into tokens (function )