730eb3d2f8
Submitted by: Sarumaru Yoshihiko <mistral at imasy or jp>
143 lines
3.9 KiB
Groff
143 lines
3.9 KiB
Groff
.\" Copyright (c) 1990, 1991, 1993
|
||
.\" The Regents of the University of California. All rights reserved.
|
||
.\"
|
||
.\" This code is derived from software contributed to Berkeley by
|
||
.\" Chris Torek and the American National Standards Committee X3,
|
||
.\" on Information Processing Systems.
|
||
.\"
|
||
.\" Redistribution and use in source and binary forms, with or without
|
||
.\" modification, are permitted provided that the following conditions
|
||
.\" are met:
|
||
.\" 1. Redistributions of source code must retain the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer.
|
||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer in the
|
||
.\" documentation and/or other materials provided with the distribution.
|
||
.\" 3. All advertising materials mentioning features or use of this software
|
||
.\" must display the following acknowledgement:
|
||
.\" This product includes software developed by the University of
|
||
.\" California, Berkeley and its contributors.
|
||
.\" 4. Neither the name of the University nor the names of its contributors
|
||
.\" may be used to endorse or promote products derived from this software
|
||
.\" without specific prior written permission.
|
||
.\"
|
||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||
.\" SUCH DAMAGE.
|
||
.\"
|
||
.\" @(#)strstr.3 8.1 (Berkeley) 6/4/93
|
||
.\" %FreeBSD: src/lib/libc/string/strstr.3,v 1.3.2.5 2001/12/25 00:36:53 ache Exp %
|
||
.\"
|
||
.\" $FreeBSD$
|
||
.Dd October 11, 2001
|
||
.Dt STRSTR 3
|
||
.Os
|
||
.Sh ̾<EFBFBD><EFBFBD>
|
||
.Nm strstr , strcasestr , strnstr
|
||
.Nd ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD><EFBFBD>֤<EFBFBD>õ<EFBFBD><EFBFBD>
|
||
.Sh <EFBFBD>饤<EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD>
|
||
.Lb libc
|
||
.Sh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.In string.h
|
||
.Ft char *
|
||
.Fn strstr "const char *big" "const char *little"
|
||
.Ft char *
|
||
.Fn strcasestr "const char *big" "const char *little"
|
||
.Ft char *
|
||
.Fn strnstr "const char *big" "const char *little" "size_t len"
|
||
.Sh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Fn strstr
|
||
<EFBFBD>ؿ<EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD>̥<EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Fa big
|
||
<EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>
|
||
<EFBFBD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Ȥ<EFBFBD><EFBFBD><EFBFBD>
|
||
.Fa big
|
||
<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>
|
||
.Fa little
|
||
<EFBFBD><EFBFBD>
|
||
.Fa big
|
||
<EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>NULL <20><><EFBFBD>֤<EFBFBD><D6A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><EFBFBD>ΤȤ<EFBFBD><EFBFBD>ϡ<EFBFBD>
|
||
<EFBFBD>ǽ<EFBFBD><EFBFBD>˽и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Fa little
|
||
<EFBFBD>κǽ<EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>ؤΥݥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
||
.Sh <EFBFBD><EFBFBD>
|
||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>
|
||
.Va largestring
|
||
<EFBFBD><EFBFBD>
|
||
.Qq Li Bar Baz
|
||
<EFBFBD><EFBFBD>ʬ<EFBFBD><EFBFBD><EFBFBD>ݥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Va ptr
|
||
<EFBFBD>˥<EFBFBD><EFBFBD>åȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
||
.Bd -literal -offset indent
|
||
const char *largestring = "Foo Bar Baz";
|
||
const char *smallstring = "Bar";
|
||
char *ptr;
|
||
|
||
ptr = strstr(largestring, smallstring);
|
||
.Ed
|
||
.Pp
|
||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD>ݥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Va ptr
|
||
<EFBFBD><EFBFBD>
|
||
.Dv NULL
|
||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Va largestring
|
||
<EFBFBD>κǽ<EFBFBD><EFBFBD><EFBFBD> 4 ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2B8A1BA><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>
|
||
.Bd -literal -offset indent
|
||
const char *largestring = "Foo Bar Baz";
|
||
const char *smallstring = "Bar";
|
||
char *ptr;
|
||
|
||
ptr = strnstr(largestring, smallstring, 4);
|
||
.Ed
|
||
.Sh <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Xr memchr 3 ,
|
||
.Xr strchr 3 ,
|
||
.Xr strcspn 3 ,
|
||
.Xr strpbrk 3 ,
|
||
.Xr strrchr 3 ,
|
||
.Xr strsep 3 ,
|
||
.Xr strspn 3 ,
|
||
.Xr strtok 3
|
||
.Sh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
.Fn strstr
|
||
<EFBFBD>ؿ<EFBFBD><EFBFBD>ϡ<EFBFBD>
|
||
.St -isoC
|
||
<EFBFBD><EFBFBD>Ŭ<EFBFBD>礷<EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|