Commit | Line | Data |
---|---|---|
4dd93b4b KS |
1 | /* |
2 | * Determine the leftmost index of the character | |
3 | * in the string. | |
4 | */ | |
5 | ||
6 | static char *SccsId = "@(#)index.c 1.1 %G%"; | |
7 | ||
8 | char * | |
9 | index(str, ch) | |
10 | char *str; | |
11 | { | |
12 | register char *cp; | |
13 | register int c; | |
14 | ||
15 | for (c = ch, cp = str; *cp; cp++) | |
16 | if (*cp == c) | |
17 | return(cp); | |
18 | return(NOSTR); | |
19 | } |