xref: /original-bsd/lib/libc/string/strrchr.3 (revision 963f8367)
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.\"     @(#)strrchr.3	5.2 (Berkeley) 04/19/91
9.\"
10.Dd
11.Dt STRRCHR 3
12.Os
13.Sh NAME
14.Nm strrchr
15.Nd locate character in string
16.Sh SYNOPSIS
17.Fd #include <string.h>
18.Ft char *
19.Fn strrchr "const char *s" "int c"
20.Sh DESCRIPTION
21The
22.Fn strrchr
23function
24locates the last occurrence of
25.Fa c
26(converted to a char)
27in the string
28.Fa s .
29If
30.Fa c
31is
32.Ql \e0 ,
33.Fn strrchr
34locates the terminating
35.Ql \e0 .
36.Sh RETURN VALUES
37The
38.Fn strrchr
39function
40returns a pointer to the character,
41or a null
42pointer if
43.Fa c
44does not occur anywhere in
45.Fa s .
46.Sh SEE ALSO
47.Xr index 3 ,
48.Xr memchr 3 ,
49.Xr rindex 3 ,
50.Xr strchr 3 ,
51.Xr strcspn 3 ,
52.Xr strpbrk 3 ,
53.Xr strsep 3 ,
54.Xr strspn 3 ,
55.Xr strstr 3 ,
56.Xr strtok 3
57.Sh STANDARDS
58The
59.Fn strrchr
60function
61conforms to
62.St -ansiC .
63