2.14.20 strspn


size_t strspn(const char *str1, const char *str2);

Finds the first sequence of characters in the string str1 that contains any character specified in str2.

Returns the length of this first sequence of characters found that match with str2.



int main(void)
  char string[]="7803 Elm St.";

  printf("The number length is %d.\n",strspn(string,"1234567890"));

  return 0;

The output should be: The number length is 4.