malloc_get_state.3: tfix
[man-pages.git] / man3 / index.3
bloba47ce0dae6c2674579167ba8f2104aad29b56673
1 .\" Copyright 2022 Alejandro Colomar <alx@kernel.org>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH index 3 (date) "Linux man-pages (unreleased)"
6 .SH NAME
7 index, rindex \- locate character in string
8 .SH LIBRARY
9 Standard C library
10 .RI ( libc ", " \-lc )
11 .SH SYNOPSIS
12 .nf
13 .B #include <strings.h>
15 .BI "[[deprecated]] char *index(const char *" s ", int " c );
16 .BI "[[deprecated]] char *rindex(const char *" s ", int " c );
17 .fi
18 .SH DESCRIPTION
19 .BR index ()
20 is identical to
21 .BR strchr (3).
23 .BR rindex ()
24 is identical to
25 .BR strrchr (3).
27 Use
28 .BR strchr (3)
29 and
30 .BR strrchr (3)
31 instead of these functions.
32 .SH STANDARDS
33 None.
34 .SH HISTORY
35 4.3BSD; marked as LEGACY in POSIX.1-2001.
36 Removed in POSIX.1-2008,
37 recommending
38 .BR strchr (3)
39 and
40 .BR strrchr (3)
41 instead.
42 .SH SEE ALSO
43 .BR strchr (3),
44 .BR strrchr (3)