PatchworkOS
Loading...
Searching...
No Matches
strspn.c
Go to the documentation of this file.
1#include <string.h>
2
3size_t strspn(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 break;
17 }
18
19 ++p;
20 }
21
22 if (!*p)
23 {
24 return len;
25 }
26
27 ++len;
28 }
29
30 return len;
31}
size_t strspn(const char *s1, const char *s2)
Definition strspn.c:3