.TH strrchr() "" "" "String Function (libc)"
.PC "Search for rightmost occurrence of a character in a string"
.B "#include <string.h>"
\fBchar *strrchr(\fIstring\^\fB, \fIcharacter\^\fB)\fR
\fBchar *\fIstring\^\fB; int \fIcharacter\^\fB;\fR
.PP
.II "character, search for in string"
.II "search for character in a string"
.II "string, search for character in"
.II rindex()
.II "character, reverse search for"
.II "reverse search for character in string"
.II "string, reverse search for character"
.B strrchr()
looks for the last, or rightmost, occurrence of
.I character
within
.IR string .
.I character
is declared to be an
.BR int ,
but is handled within the function as a
.BR char .
Another way to describe this function is to say that it performs a
reverse search for a character in a string.
It is equivalent to the \*(PN function \fBrindex()\fR.
.PP
.B strrchr()
returns a pointer to the rightmost occurrence of
.IR character ,
or NULL if
.I character
could not be found within
.IR string .
.SH "See Also"
.Xr "libc," libc
.Xr "rindex()," rindex
.Xr "string.h" string.h
.br
\*(AS, \(sc7.11.5.5
.br
\*(PX Standard, \(sc8.1
