{{keywords>wiki library source code example reference}}
====== strspn ======
#include
size_t strspn(const char *str1, const char *str2);
===== strspn C Sourcecode Example =====
/*
* strspn example code
* http://code-reference.com/c/string.h/strspn
*/
#include
#include
int main( void )
{
const char string[] = "the answer is 42";
int pos = strspn(string, "the answer = 42");
printf("different char at position :%d\n",pos+1);
return 0;
}
==== output of strspn c example ====
different char at position :12