translation updated for string.
[scilab.git] / scilab / modules / string / help / ja_JP / strsplit.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5  * Copyright (C) INRIA - 
6  * 
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at    
11  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12  *
13  -->
14
15 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="strsplit" xml:lang="ja">
16     
17     <refnamediv>
18         
19         <refname>strsplit</refname>
20         
21         <refpurpose>文字列を文字列のベクトルに分割する</refpurpose>
22         
23     </refnamediv>
24     
25     <refsynopsisdiv>
26         
27         <title>呼び出し手順</title>
28         
29         <synopsis>
30             
31             v = strsplit(str,ind)
32             
33             [v, matched_separators] = strsplit(str)
34             
35             [v, matched_separators] = strsplit(str, matrix_of_strings, limit)
36             
37             [v, matched_separators] = strsplit(str, regexp_pattern, limit)
38             
39         </synopsis>
40         
41     </refsynopsisdiv>
42     
43     <refsection>
44         
45         <title>引数</title>
46         
47         <variablelist>
48             
49             <varlistentry>
50                 
51                 <term>str</term>
52                 
53                 <listitem>
54                     
55                     <para>分割する文字列</para>
56                     
57                 </listitem>
58                 
59             </varlistentry>
60             
61             <varlistentry>
62                 
63                 <term>ind</term>
64                 
65                 <listitem>
66                     
67                     <para>
68                         
69                         <literal>[1 length(str)-1] </literal>の範囲の
70                         
71                         単調増加のインデックスのベクトル.
72                         
73                     </para>
74                     
75                 </listitem>
76                 
77             </varlistentry>
78             
79             <varlistentry>
80                 
81                 <term>v</term>
82                 
83                 <listitem>
84                     
85                     <para>
86                         
87                         得られた文字列の列ベクトル (次元 
88                         
89                         &gt;<literal>size(ind,'*')+1</literal>).
90                         
91                     </para>
92                     
93                 </listitem>
94                 
95             </varlistentry>
96             
97             <varlistentry>
98                 
99                 <term>matched_separators</term>
100                 
101                 <listitem>
102                     
103                     <para>一致したセパレータの列ベクトル</para>
104                     
105                 </listitem>
106                 
107             </varlistentry>
108             
109             <varlistentry>
110                 
111                 <term>matrix_of_strings</term>
112                 
113                 <listitem>
114                     
115                     <para>strの中で検索する文字列の行列</para>
116                     
117                 </listitem>
118                 
119             </varlistentry>
120             
121             <varlistentry>
122                 
123                 <term>regexp_pattern</term>
124                 
125                 <listitem>
126                     
127                     <para>正規表現パターン</para>
128                     
129                 </listitem>
130                 
131             </varlistentry>
132             
133             <varlistentry>
134                 
135                 <term>limit</term>
136                 
137                 <listitem>
138                     
139                     <para>要素数の最大値</para>
140                     
141                 </listitem>
142                 
143             </varlistentry>
144             
145         </variablelist>
146         
147     </refsection>
148     
149     <refsection>
150         
151         <title>説明</title>
152         
153         <para>
154             
155             <code>v= strsplit(str, ind)</code>は,文字列<varname>str</varname>を
156             
157             <varname>ind</varname>で添字が指定された点
158             
159             (<varname>ind</varname>の添字が指す各文字の後)で,
160             
161             文字列のベクトルに分割します.
162             
163         </para>
164         
165         <para>
166             
167             <code>strsplit(str)</code> は,
168             
169             <code>strsplit(str,1:length(str)-1)</code>と同じ文字列を返します.
170             
171         </para>
172         
173         <para>
174             
175             <code>strsplit(str, regexp_pattern, limit)</code>は
176             
177             文字列の列ベクトルを返します.
178             
179             その各々は,大文字小文字を区別する正規表現により構築された境界で
180             
181             分割された<varname>str</varname> の部分文字列です.
182             
183         </para>
184         
185         <para>
186             
187             パターンが<literal>n</literal>回現れる場合,
188             
189             返される配列は<literal>n+1</literal>個の要素を有します.
190             
191         </para>
192         
193         <para>
194             
195             例えば, パターンが1回も存在しなかった場合,
196             
197             1要素のみの配列が返されます.
198             
199             もちろん,これは<varname>str</varname>が空の場合も同じです.
200             
201         </para>
202         
203         <para>
204             
205             <varname>limit</varname>が設定された場合,返される配列には
206             
207             最大<varname>limit</varname>個の要素が含まれ,
208             
209             その最後の要素には文字列の残り全体が含まれます.
210             
211         </para>
212         
213         <para>
214             
215             <code>strsplit(str, matrix_of_strings, limit)</code>は,
216             
217             <varname>str</varname>を任意の要素で分割します.
218             
219             これにより,
220             
221             正規表現を知らないユーザが異なるセパレータで分割することが
222             
223             できるようになります.
224             
225         </para>
226         
227         <para>
228             
229             <code>strsplit()</code>が第2の出力引数を指定してコールされた場合,
230             
231             一致したセパレータの列ベクトルが返されます.
232             
233         </para>
234         
235     </refsection>
236     
237     <refsection>
238         
239         <title>例</title>
240         
241         <programlisting role="example"><![CDATA[ 
242 S='strsplit splits a string into a vector of strings';
243 strsplit(S,[15 25 30])
244 ind=strindex(S,' ')
245 [r_1, r_2] = strsplit("abcd")
246 [r_1, r_2] = strsplit("root:x:0:0:root:/root:/bin/bash",":",5)
247 [r_1, r_2] = strsplit("abc,def:ijk,:lmo","/:|,/")
248 [r_1, r_2] = strsplit("abc,def:ijk,:lmo",[":";","])    
249 strsplit("abcdef2ghijkl3mnopqr6stuvw7xyz","/\d+/") 
250 [r_1, r_2] = strsplit("abcdef2ghijkl3mnopqr6stuvw7xyz","/\d+/",2) 
251  ]]></programlisting>
252         
253     </refsection>
254     
255     <refsection role="see also">
256         
257         <title>参照</title>
258         
259         <simplelist type="inline">
260             
261             <member>
262                 
263                 <link linkend="part"> part</link>
264                 
265             </member>
266             
267             <member>
268                 
269                 <link linkend="strcat"> strcat</link>
270                 
271             </member>
272             
273             <member>
274                 
275                 <link linkend="tokens"> tokens</link>
276                 
277             </member>
278             
279             <member>
280                 
281                 <link linkend="regexp"> regexp</link>
282                 
283             </member>
284             
285         </simplelist>
286         
287     </refsection>
288     
289 </refentry>
290