1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 17:56:43 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Added history, aeb, 980113.
29 .\" 2005-05-05 mtk: added strcasestr()
31 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
32 .\" all rights reserved.
33 .\" Translated Tue Dec 16 10:06:54 JST 1997
34 .\" by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\" Updated Sun Sep 5 JST 1999 by by Kentaro Shirakata <argrath@yo.rim.or.jp>
36 .\" Updated Wed Apr 20 JST 2005 by by Kentaro Shirakata <argrath@ub32.org>
38 .TH STRSTR 3 2011-09-28 "GNU" "Linux Programmer's Manual"
41 .\"O strstr, strcasestr \- locate a substring
42 strstr, strcasestr \- Éôʬʸ»úÎó¤Î°ÌÃÖ¤ò¼¨¤¹
46 .B #include <string.h>
48 .BI "char *strstr(const char *" haystack ", const char *" needle );
50 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
51 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
53 .B #include <string.h>
55 .BI "char *strcasestr(const char *" haystack ", const char *" needle );
61 .\"O function finds the first occurrence of the substring
62 .\"O \fIneedle\fP in the string \fIhaystack\fP.
63 .\"O The terminating null bytes (\(aq\\0\(aq) are not compared.
65 ´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó \fIneedle\fP ¤¬Ê¸»úÎó \fIhaystack\fP Ãæ
66 ¤ÇºÇ½é¤Ë¸½¤ì¤ë°ÌÃÖ¤ò¸«¤Ä¤±¤ë¡£
67 ʸ»úÎó¤ò½ªÃ¼ NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤ÏÈæ³Ó¤µ¤ì¤Ê¤¤¡£
70 .\"O .BR strcasestr ()
73 .\"O but ignores the case of both arguments.
78 ξÊý¤Î°ú¿ô¤ËÂФ·¤ÆÂçʸ»ú¾®Ê¸»ú¤ò̵»ë¤¹¤ë¡£
79 .\"O .SH "RETURN VALUE"
81 .\"O These functions return a pointer to the beginning of the
82 .\"O substring, or NULL if the substring is not found.
83 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Éôʬʸ»úÎó¤Î³«»Ï¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢
84 ¤â¤·Éôʬʸ»úÎ󤬸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
85 .\"O .SH "CONFORMING TO"
89 .\"O function conforms to C89 and C99.
91 .\"O .BR strcasestr ()
92 .\"O function is a nonstandard extension.
94 ´Ø¿ô¤Ï C89 ¤È C99 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
96 ´Ø¿ô¤ÏÈóɸ½à³ÈÄ¥¤Ç¤¢¤ë¡£
99 .\"O Early versions of Linux libc (like 4.5.26) would not allow
100 .\"O an empty \fIneedle\fP argument for
102 .\"O Later versions (like 4.6.27) work correctly,
103 .\"O and return \fIhaystack\fP when \fIneedle\fP is empty.
104 Linux libc ¤Î½é´ü¤Î¥Ð¡¼¥¸¥ç¥ó(4.5.26 ¤Þ¤Ç)¤Ï
106 ´Ø¿ô¤Î \fIneedle\fP °ú¿ô¤Ë¶õʸ»úÎó¤ò»ØÄê¤Ç¤¤Ê¤¤¡£
107 ºÇ¶á¤Î¥Ð¡¼¥¸¥ç¥ó(4.6.27 °Ê¹ß)¤ÏÀµ¤·¤¯Æ°ºî¤·¡¢
108 \fIneedle\fP ¤¬¶õ¤Î»þ¤Ï \fIhaystack\fP ¤òÊÖ¤¹¡£