

strspn()                 String Function                 strspn()




Return length a string includes characters in another

#include <string.h>
uunnssiiggnneedd iinntt ssttrrssppnn(_s_t_r_i_n_g_1, _s_t_r_i_n_g_2);
cchhaarr *_s_t_r_i_n_g_1; cchhaarr *_s_t_r_i_n_g_2;

strspn returns  the length  for which string1  initially consists
only of characters that are found in string2.  For example,


        char *s1 = "hello, world";
        char *s2 = "kernighan & ritchie";
        strcspn(s1, s2);


returns two,  which is the length for which  the first string in-
itially consists of characters found in the second.

***** See Also *****

string functions, string.h



































COHERENT Lexicon                                           Page 1


