DOKK / manpages / debian 12 / manpages-dev / rindex.3.en
index(3) Library Functions Manual index(3)

index, rindex - locate character in string

Standard C library (libc, -lc)

#include <strings.h>
[[deprecated]] char *index(const char *s, int c);
[[deprecated]] char *rindex(const char *s, int c);

index() is identical to strchr(3).

rindex() is identical to strrchr(3).

Use strchr(3) and strrchr(3) instead of these functions.

4.3BSD; marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specifications of index() and rindex(), recommending strchr(3) and strrchr(3) instead.

strchr(3), strrchr(3)

2023-01-05 Linux man-pages 6.03