home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
libfake
/
strspn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-27
|
436b
|
26 lines
/*
* strspn - find length of initial segment of s consisting entirely
* of characters from accept
*/
int
strspn(s, accept)
char *s;
char *accept;
{
register char *sscan;
register char *ascan;
register int 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);
}