3.11. strcspn

size_t strcspn( const char *s1, const char *s2);
strcspn returns the length of the prefix of s1 consisting of characters NOT in s2.

In other words, strcspn counts how many of the leading characters of s1 are NOT from the set of characters specified in s2.