size_t strspn ( const char * string1, const char * string2 );
Get length of substring composed of given characters.
Scans string1 character by character, returning the number of characters read before the first character not included in string2 is found.
The search does not include terminating null-characters.
Returns the length of the initial substring of string1 that is only composed of characters included in string2.
Defined in ANSI-C.
/* strspn example */
char strtext = "129th";
char cset = "1234567890";
i = strspn (strtext,cset);
printf ("Length of initial number is %d\n",i);
Length of initial number is 3
strcspn, strstr, strchr, strrchr