Is there a C function that can do the equivalent of find_first_not_of, getting the search string and character set, and returning the first character in the string and not in the set?
The function strspn will take you most of the way. (You just need to massage the return value a little.)
strspn