xref: /original-bsd/lib/libc/string/strstr.3 (revision a1c2194a)
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 and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)strstr.3	5.3 (Berkeley) 06/29/91
11.\"
12.Dd
13.Dt STRSTR 3
14.Os
15.Sh NAME
16.Nm strstr
17.Nd locate a substring in a string
18.Sh SYNOPSIS
19.Fd #include <string.h>
20.Ft char *
21.Fn strstr "const char *big" "const char *little"
22.Sh DESCRIPTION
23The
24.Fn strstr
25function
26locates the first occurrence of the null-terminated string
27.Fa little
28in the null-terminated string
29.Fa big .
30If
31.Fa little
32is the empty string,
33.Fn strstr
34returns
35.Fa big ;
36if
37.Fa little
38occurs nowhere in
39.Fa big ,
40.Fn strstr
41returns NULL;
42otherwise
43.Fn strstr
44returns a pointer to the first character of the first occurrence of
45.Fa little .
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 strrchr 3 ,
54.Xr strsep 3 ,
55.Xr strspn 3 ,
56.Xr strtok 3
57.Sh STANDARDS
58The
59.Fn strstr
60function
61conforms to
62.St -ansiC .
63