strrchr(3) Library Functions Manual strrchr(3)

strrchr - string rear-search character

Standard C library (libc-lc)

#include <string.h>
char *strrchr(const char *s, int c);

strrchr() returns a pointer to the last occurrence of the character c in the string s.

It is equivalent to


memrchr(s, c, strlen(s) + 1)

See strchr(3).

For an explanation of the terms used in this section, see attributes(7).

Interface Attribute Value
strrchr () Thread safety MT-Safe

C11, POSIX.1-2008.

POSIX.1-2001, C89, SVr4, 4.3BSD.

string(3), strchr(3), wcsrchr(3)

2026-08-10 Linux man-pages 6.19