* Get ride of the useless tag
[scilab.git] / scilab / modules / string / help / en_US / part.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA - 
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="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="part" xml:lang="en">
14     <refnamediv>
15         <refname>part</refname>
16         <refpurpose>extraction of strings</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[strings_out] = part(strings_in, v)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>strings_in, strings_out</term>
27                 <listitem>
28                     <para>Matrix of character strings.</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>v</term>
33                 <listitem>
34                     <para>Integer row vector.</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             Let <literal>s[k]</literal> stands for the <literal>k</literal>
43             character of string <literal>s</literal> ( or the white space character if
44             <literal>k &gt;length(s)</literal>).
45         </para>
46         <para>
47             <literal>part</literal> returns <literal>strings_out</literal>, a
48             matrix of character strings, such that <literal>strings_out(i,j)</literal>
49             is the string <literal>"s[v(1)]...s[v(n)]"</literal> (
50             <literal>s=strings_in(i,j)</literal> ).
51         </para>
52     </refsection>
53     <refsection>
54         <title>Examples</title>
55         <programlisting role="example"><![CDATA[ 
56 // returns characters position 8 to 11
57 part("How to use ""part"" ?",8:11)
58
59 // returns characters position 2 to 4 for each element
60 // no characters replaced by ''
61 c = part(['a','abc','abcd'],2:4)
62
63 // returns character position 1 for each element and add characters position 4 to 7 of each element
64 c = part(['abcdefg','hijklmn','opqrstu'],[1,4:7]);
65
66 // returns character 4 for each element, add characters position 1 to 7 and add character position 4 for each element
67 c = part(['abcdefg','hijklmn','opqrstu'],[4,1:7,4]);
68
69 // returns character position 1,add again character position 1 and character position 2
70 c=part(['a','abc','abcd'],[1,1,2])
71
72 // a a a  
73 part(['a','abc','abcd'],[1])
74
75 // aa aa aa 
76 part(['a','abc','abcd'],[1,1])
77
78 // aa aab aab 
79 part(['a','abc','abcd'],[1,1,2])
80  ]]></programlisting>
81     </refsection>
82     <refsection role="see also">
83         <title>See Also</title>
84         <simplelist type="inline">
85             <member>
86                 <link linkend="string">string</link>
87             </member>
88             <member>
89                 <link linkend="length">length</link>
90             </member>
91         </simplelist>
92     </refsection>
93 </refentry>