C中的strpbrk()
该函数strpbrk()用于查找第一个字符串的第一个字符,并将其与第二个字符串的任何字符匹配。如果未找到匹配项,则返回NULL,否则返回指向第一个字符串的字符的指针,该指针与第二个字符串的字符匹配。
这是strpbrk()C语言的语法,
char *strpbrk(const char *string1, const char *string2)
这是strpbrk()C语言的示例,
示例
#include <stdio.h>
#include <string.h>
int main () {
const char s1[] = "Helloworld";
const char s2[] = "Blank";
char *result;
result = strpbrk(s1, s2);
printf("The matching character : %c\n", *result);
return(0);
}输出结果
The matching character : l
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短