xref: /original-bsd/lib/libc/string/rindex.3 (revision 0e8defd9)
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
6.\" %sccs.include.redist.man%
7.\"
8.\"     @(#)rindex.3	5.2 (Berkeley) 04/19/91
9.\"
10.Dd
11.Dt RINDEX 3
12.Os
13.Sh NAME
14.Nm rindex
15.Nd locate character in string
16.Sh SYNOPSIS
17.Fd #include <string.h>
18.Ft char *
19.Fn rindex "const char *s" "int c"
20.Sh DESCRIPTION
21The
22.Fn rindex
23function
24locates the last character
25matching
26.Fa c
27(converted to a
28.Em char )
29in the null-terminated string
30.Fa s .
31The character c is returned if it is found; otherwise NULL is returned.
32If
33.Fa c
34is
35.Ql \e0 ,
36.Fn rindex
37locates the terminating
38.Ql \e0 .
39.Sh SEE ALSO
40.Xr index 3 ,
41.Xr memchr 3 ,
42.Xr strchr 3 ,
43.Xr strcspn 3 ,
44.Xr strpbrk 3 ,
45.Xr strrchr 3 ,
46.Xr strsep 3 ,
47.Xr strspn 3 ,
48.Xr strstr 3 ,
49.Xr strtok 3
50.Sh HISTORY
51A
52.Fn rindex
53function appeared in
54.At v6 .
55