1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
4 .\" all rights reserved.
5 .\" Translated Fri Dec 12 12:41:35 JST 1997
6 .\" by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
8 .\" Permission is granted to make and distribute verbatim copies of this
9 .\" manual provided the copyright notice and this permission notice are
10 .\" preserved on all copies.
12 .\" Permission is granted to copy and distribute modified versions of this
13 .\" manual under the conditions for verbatim copying, provided that the
14 .\" entire resulting derived work is distributed under the terms of a
15 .\" permission notice identical to this one.
17 .\" Since the Linux kernel and libraries are constantly changing, this
18 .\" manual page may be incorrect or out-of-date. The author(s) assume no
19 .\" responsibility for errors or omissions, or for damages resulting from
20 .\" the use of the information contained herein. The author(s) may not
21 .\" have taken the same level of care in the production of this manual,
22 .\" which is licensed free of charge, as they might when working
25 .\" Formatted or processed versions of this manual, if unaccompanied by
26 .\" the source, must acknowledge the copyright and authors of this work.
28 .\" References consulted:
29 .\" Linux libc source code
30 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
32 .\" Modified Mon Apr 12 12:54:34 1993, David Metcalfe
33 .\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu)
34 .TH INDEX 3 2010-09-20 "GNU" "Linux Programmer's Manual"
37 .\"O index, rindex \- locate character in string
38 index, rindex \- ʸ»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤ò¼¨¤¹
42 .B #include <strings.h>
44 .BI "char *index(const char *" s ", int " c );
46 .BI "char *rindex(const char *" s ", int " c );
52 .\"O function returns a pointer to the first occurrence
53 .\"O of the character \fIc\fP in the string \fIs\fP.
55 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP ¤¬
56 ¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
60 .\"O function returns a pointer to the last occurrence
61 .\"O of the character \fIc\fP in the string \fIs\fP.
63 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP ¤¬
64 ¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
66 .\"O The terminating NULL character is considered to be a part of the
68 ʸ»úÎó¤ò½ªÃ¼¤¹¤ë NULL ʸ»ú¤Ï¡¢Ê¸»úÎó¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¡£
69 .\"O .SH "RETURN VALUE"
75 .\"O functions return a pointer to
76 .\"O the matched character or NULL if the character is not found.
80 ´Ø¿ô¤Ï¡¢°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢
81 ¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
82 .\"O .SH "CONFORMING TO"
84 .\"O 4.3BSD; marked as LEGACY in POSIX.1-2001.
86 POSIX.1-2001 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£
87 .\"O POSIX.1-2008 removes the specifications of
100 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
105 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£