home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Borland Programmer's Resource
/
Borland_Programmers_Resource_CD_1995.iso
/
utils
/
source
/
sh
/
std
/
stdc
/
strcspn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-18
|
467b
|
26 lines
#include <string.h>
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
size_t
strcspn(s, reject)
Const char *s;
Const char *reject;
{
register Const char *scan;
register Const char *rscan;
register size_t count;
count = 0;
for (scan = s; *scan != '\0'; scan++) {
for (rscan = reject; *rscan != '\0';) /* ++ moved down. */
if (*scan == *rscan++)
return(count);
count++;
}
return(count);
}