C Programming/string.h/strspn

strspn function is used to find out the length of substring or length of maximum initial segment of the string pointed to by one string, let's say s1 containing all characters from another string pointed to by another string say s2.While strscpn is used to find out length of initial segment containing all elements not in the reject list.

Syntax
size_t strspn(const char *s, const char *accept);

size_t strcspn(const char *s, const char *reject);

Parameters
s1- It points to null-terminated string to be searched.

s2- It points to null-terminated set of characters.

Reference
ANSI/ISO 9899-1990. Linux programmer's manual.