home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
LIB
/
unix.zoo
/
strcspn.c
< prev
next >
Wrap
Text File
|
2009-11-06
|
635b
|
28 lines
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
int strcspn(s, reject)
char *s;
char *reject;
{
register char *scan;
register char *rscan;
register int count;
count = 0;
for (scan = s; *scan ; scan++)
{
for (rscan = reject; *rscan ; )
{ /* ++ moved down. */
if (*scan == *rscan++) return (count);
}
count++;
}
return (count);
} /* end of strcspn */