xref: /original-bsd/usr.bin/mail/index.c (revision 0999a820)
1 /*
2  * Determine the leftmost index of the character
3  * in the string.
4  */
5 
6 static char *SccsId = "@(#)index.c	2.1 07/01/81";
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 }
20