strcspn() - String Manipulation Function
How to perform string complement span in C++?
manipulation function returns the index of the first character in the str1 that matches any of the characters in str2 by complement span.
size_t strcspn ( const char * str1, const char * str2 );
int main ()
char str1 = "i got 2nd rank in the class";
char str2 = "1234567890";
j = strcspn (str1,str2);
printf ("Occurence of a number in
str1 is at %dth position.\n",j+1);
Occurence of a number in str1 is at 7th position.
In the above example, "strcspn()" manipulation function is used find index of appearance of any one integer contained in "str2" in "str1" through complement span.