Files
photon/libc/string/strcspn.c

16 lines
278 B
C

#include <stddef.h>
size_t strcspn(const char *str1, const char *str2)
{
size_t i;
for (i = 0; str1[i]; i++) {
for (size_t ii = 0; str2[ii]; ii++) {
if (str1[i] == str2[ii]) {
return i;
}
}
}
return i;
}