C语言中 strpbrk()
函数 strpbrk() 用于查找第一个字符串的第一个字符,并将其与第二个字符串的任意字符相匹配。 如果没有找到匹配项,则返回 NULL,否则返回指向第一个字符串的字符(与第二个字符串的字符相匹配)的指针。
以下是 C 语言中 strpbrk() 的语法,
char *strpbrk(const char *string1, const char *string2)
以下是 C 语言中 strpbrk() 的一个示例,
示例
#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
", *result);
return(0);
}输出
The matching character : l
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C语言编程
C++
C#
MongoDB
MySQL
Javascript
PHP