blob: 78277ae78720feb77fd11e4b394b2dd9fe7dfb76 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <stddef.h>
#include <string.h>
size_t strspn(const char *s1, const char *s2)
{
size_t count = 0;
while (*s1 != '\0' && strchr(s2, *s1) != NULL) {
count++;
s1++;
}
return count;
}
|