index, rindex
Purpose
Locates a character in a string.
Library
Berkeley Library (libbsd.a)
Syntax
char *index (string, character) char *rindex (string, character)
char *string, *character; char *string, *character;
Description
The index subroutine returns a pointer to the first
occurrence of character in string, while the rindex sub-
routine returns a pointer to the last occurrence of char-
acter in string. Both subroutines return a value of 0 if
the character does not occur in the string.
These functions operate on null-terminated strings. They
do not check for overflow of any receiving string.
See "string" for more information on the strchr and
strrchr subroutines, which can be used to perform the
same operations.
Related Information
In this book: "string."
inet_addr, inet_network, inet_ntoa, inet_makeaddr,