.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" May be distributed under the GNU General Public License .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Mon Apr 12 12:54:34 1993, David Metcalfe .\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu) .TH INDEX 3 "April 12, 1993" "GNU" "Linux Programmer's Manual" .SH NAME index, rindex \- locate character in string .SH SYNOPSIS .nf .B #include .sp .BI "char *index(const char *" s ", int " c ); .sp .BI "char *rindex(const char *" s ", int " c ); .fi .SH DESCRIPTION The \fBindex()\fP function returns a pointer to the first occurrence of the character \fIc\fP in the string \fIs\fP. .PP The \fBrindex()\fP function returns a pointer to the last occurrence of the character \fIc\fP in the string \fIs\fP. .PP The terminating NULL character is considered to be a part of the strings. .SH "RETURN VALUE" The \fBindex()\fP and \fBrindex()\fP functions return a pointer to the matched character or NULL if the character is not found. .SH "CONFORMING TO" BSD 4.3 .SH SEE ALSO .BR memchr "(3), " strchr "(3), " strpbrk "(3), " strrchr (3), .BR strsep "(3), " strspn "(3), " strstr "(3), " strtok (3)