#include <string.h>
size_t strspn(const char *string1, const char *string2);
The strspn() function calculates the length of the maximum initial portion of the string pointed to by string1 that consists entirely of the characters contained in the string pointed to by string2.
The strspn() function returns the length of the substring found.