Sponsor:

Your company here, and a link to your site. Click to find out more.

index - Man Page

locate character in string

Library

Standard C library (libc, -lc)

Synopsis

#include <strings.h>

[[deprecated]] char *index(const char *s, int c);
[[deprecated]] char *rindex(const char *s, int c);

Description

index() is identical to strchr(3).

rindex() is identical to strrchr(3).

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

Standards

None.

History

4.3BSD; marked as LEGACY in POSIX.1-2001. Removed in POSIX.1-2008, recommending strchr(3) and strrchr(3) instead.

See Also

strchr(3), strrchr(3)

Referenced By

The man page rindex(3) is an alias of index(3).

2023-10-31 Linux man-pages 6.7