xref: /csrg-svn/lib/libc/string/strstr.3 (revision 61193)
1*61193Sbostic.\" Copyright (c) 1990, 1991, 1993
2*61193Sbostic.\"	The Regents of the University of California.  All rights reserved.
341983Sbostic.\"
441983Sbostic.\" This code is derived from software contributed to Berkeley by
550327Sbostic.\" Chris Torek and the American National Standards Committee X3,
650327Sbostic.\" on Information Processing Systems.
750327Sbostic.\"
841983Sbostic.\" %sccs.include.redist.man%
941983Sbostic.\"
10*61193Sbostic.\"     @(#)strstr.3	8.1 (Berkeley) 06/04/93
1141983Sbostic.\"
1248350Scael.Dd
1348350Scael.Dt STRSTR 3
1448350Scael.Os
1548350Scael.Sh NAME
1648350Scael.Nm strstr
1748350Scael.Nd locate a substring in a string
1848350Scael.Sh SYNOPSIS
1948350Scael.Fd #include <string.h>
2048350Scael.Ft char *
2148350Scael.Fn strstr "const char *big" "const char *little"
2248350Scael.Sh DESCRIPTION
2348350ScaelThe
2448350Scael.Fn strstr
2548350Scaelfunction
2641983Sbosticlocates the first occurrence of the null-terminated string
2748350Scael.Fa little
2841983Sbosticin the null-terminated string
2948350Scael.Fa big .
3041983SbosticIf
3148350Scael.Fa little
3241983Sbosticis the empty string,
3348350Scael.Fn strstr
3441983Sbosticreturns
3548350Scael.Fa big ;
3641983Sbosticif
3748350Scael.Fa little
3841983Sbosticoccurs nowhere in
3948350Scael.Fa big ,
4048350Scael.Fn strstr
4141983Sbosticreturns NULL;
4241983Sbosticotherwise
4348350Scael.Fn strstr
4441983Sbosticreturns a pointer to the first character of the first occurrence of
4548350Scael.Fa little .
4648350Scael.Sh SEE ALSO
4748350Scael.Xr index 3 ,
4848350Scael.Xr memchr 3 ,
4948350Scael.Xr rindex 3 ,
5048350Scael.Xr strchr 3 ,
5148350Scael.Xr strcspn 3 ,
5248350Scael.Xr strpbrk 3 ,
5348350Scael.Xr strrchr 3 ,
5448350Scael.Xr strsep 3 ,
5548350Scael.Xr strspn 3 ,
5648350Scael.Xr strtok 3
5748350Scael.Sh STANDARDS
5848350ScaelThe
5948350Scael.Fn strstr
6048350Scaelfunction
6148350Scaelconforms to
6248350Scael.St -ansiC .
63