MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / strspn

Function strspn

Kernel/src/string.cpp:174–180  ·  view source on GitHub ↗

strspn - Get initial length of s1 including only the characters of s2

Source from the content-addressed store, hash-verified

172
173// strspn - Get initial length of s1 including only the characters of s2
174size_t strspn(const char *s1, const char *s2)
175{
176 size_t ret = 0;
177 while (*s1 && strchr(s2, *s1++))
178 ret++;
179 return ret;
180}
181
182// strspn - Get initial length of s1 excluding the characters of s2
183size_t strcspn(const char *s1, const char *s2)

Callers 1

strtokFunction · 0.85

Calls 1

strchrFunction · 0.85

Tested by

no test coverage detected