xref: /csrg-svn/lib/libc/string/strchr.3 (revision 48373)
1*48373Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
241968Sbostic.\" All rights reserved.
341968Sbostic.\"
441968Sbostic.\" This code is derived from software contributed to Berkeley by
541968Sbostic.\" Chris Torek.
641968Sbostic.\" %sccs.include.redist.man%
741968Sbostic.\"
8*48373Scael.\"     @(#)strchr.3	5.2 (Berkeley) 04/20/91
941968Sbostic.\"
10*48373Scael.Dd
11*48373Scael.Dt STRCHR 3
12*48373Scael.Os
13*48373Scael.Sh NAME
14*48373Scael.Nm strchr
15*48373Scael.Nd locate character in string
16*48373Scael.Sh SYNOPSIS
17*48373Scael.Fd #include <string.h>
18*48373Scael.Ft char *
19*48373Scael.Fn strchr "const char *s" "int c"
20*48373Scael.Sh DESCRIPTION
21*48373ScaelThe
22*48373Scael.Fn strchr
23*48373Scaelfunction locates the first occurence of
24*48373Scael.Ar c
25*48373Scaelin the string pointed to by
26*48373Scael.Ar s .
27*48373ScaelThe terminating
28*48373Scael.Dv NUL
29*48373Scaelcharacter is considered part of the string.
3041968SbosticIf
31*48373Scael.Fa c
32*48373Scaelis
33*48373Scael.Ql \e0 ,
34*48373Scael.Fn strchr
35*48373Scaellocates the terminating
36*48373Scael.Ql \e0 .
37*48373Scael.Sh RETURN VALUES
38*48373ScaelThe function
39*48373Scael.Fn strchr
40*48373Scaelreturns a pointer to the located character, or
41*48373Scael.Dv NULL
42*48373Scaelif the character does not appear in the string.
43*48373Scael.Sh SEE ALSO
44*48373Scael.Xr index 3 ,
45*48373Scael.Xr memchr 3 ,
46*48373Scael.Xr rindex 3 ,
47*48373Scael.Xr strcspn 3 ,
48*48373Scael.Xr strpbrk 3 ,
49*48373Scael.Xr strrchr 3 ,
50*48373Scael.Xr strsep 3 ,
51*48373Scael.Xr strspn 3 ,
52*48373Scael.Xr strstr 3 ,
53*48373Scael.Xr strtok 3
54*48373Scael.Sh STANDARDS
55*48373ScaelThe
56*48373Scael.Fn strchr
57*48373Scaelfunction
58*48373Scaelconforms to
59*48373Scael.St -ansiC .
60