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