PatchworkOS
Loading...
Searching...
No Matches
strcspn.c
Go to the documentation of this file.
1#include <string.h>
2
3size_t strcspn(const char* s1, const char* s2)
4{
5 size_t len = 0;
6 const char* p;
7
8 while (s1[len])
9 {
10 p = s2;
11
12 while (*p)
13 {
14 if (s1[len] == *p++)
15 {
16 return len;
17 }
18 }
19
20 ++len;
21 }
22
23 return len;
24}
size_t strcspn(const char *s1, const char *s2)
Definition strcspn.c:3