lib: c: core: implement strchr and strcspn
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#include <stddef.h>
|
||||
|
||||
size_t strcspn(const char *dest, const char *src)
|
||||
{
|
||||
size_t i = 0;
|
||||
for (i = 0; dest[i]; i++) {
|
||||
for (size_t ii = 0; src[ii]; i++) {
|
||||
if (dest[i] == src[ii]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
Reference in New Issue
Block a user