c语言,strcspn,在串中查找第一个给定字符集内容的段

函数名: strcspn
功 能: 在串中查找第一个给定字符集内容的段
用 法: int strcspn(char *str1, char *str2);
程序例:
#include <stdio.h>
#include <string.h>
#include <alloc.h>
int main(void)
{
char *string1 = "1234567890";
char *string2 = "747DC8";
int length;
length = strcspn(string1, string2);
printf("Character where strings intersect is at position %d ", length);
return 0;
}

原文地址:https://www.cnblogs.com/wsq724439564/p/3258173.html