home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
109.lha
/
PD_C
/
lib
/
strspn.c
< prev
next >
Wrap
Text File
|
1986-11-20
|
654b
|
26 lines
/*
* strspn - find length of initial segment of s consisting entirely
* of characters from accept
*/
SIZET
strspn(s, accept)
CONST char *s;
CONST char *accept;
{
register CONST char *sscan;
register CONST char *ascan;
register SIZET count;
count = 0;
for (sscan = s; *sscan != '\0'; sscan++) {
for (ascan = accept; *ascan != '\0'; ascan++)
if (*sscan == *ascan)
break;
if (*ascan == '\0')
return(count);
count++;
}
return(count);
}