[net.unix] questions on rindex

dixon@ihuxa.UUCP (09/18/83)

Can someone tell me what rindex() does and what it returns when it fails?
Is strchr() or strrchr() the BTL UNIX equivalent for rindex()?
Thank you in advance.

d a dixon    ihuxa!dixon    BTL - IH    (312) 979-6844

gwyn@brl-vld@sri-unix.UUCP (09/21/83)

From:      Doug Gwyn (VLD/VMB) <gwyn@brl-vld>

strchr() is the new name for index(),
and strrchr() is the new name for rindex().
The names were changed somewhere before UNIX System III
in order to give all the string(3) functions names starting
with "str".

strrchr() searches for the rightmost occurrence of the
specified character in a null-terminated string and
returns a pointer to the found character, or NULL if the
character is not in the string.