2.2.19 size_t strcspn

size_t strcspn(const char *__s, const char *__reject) __ATTR_PURE__

The strcspn() function calculates the length of the initial segment of s which consists entirely of characters not in reject.

Remember:

The strcspn() function returns the number of characters in the initial segment of s which are not in the string reject. The terminating zero is not considered as a part of string.