Add role in the 'see also' section in the help page
[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 version="5.0-subset Scilab" xml:id="part" xml:lang="en"
14           xmlns="http://docbook.org/ns/docbook"
15           xmlns:xlink="http://www.w3.org/1999/xlink"
16           xmlns:svg="http://www.w3.org/2000/svg"
17           xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook">
20   <info>
21     <pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
22     $</pubdate>
23   </info>
24
25   <refnamediv>
26     <refname>part</refname>
27
28     <refpurpose>extraction of strings</refpurpose>
29   </refnamediv>
30
31   <refsynopsisdiv>
32     <title>Calling Sequence</title>
33
34     <synopsis>[strings_out] = part(strings_in, v)</synopsis>
35   </refsynopsisdiv>
36
37   <refsection>
38     <title>Arguments</title>
39
40     <variablelist>
41       <varlistentry>
42         <term>strings_in, strings_out</term>
43
44         <listitem>
45           <para>Matrix of character strings.</para>
46         </listitem>
47       </varlistentry>
48
49       <varlistentry>
50         <term>v</term>
51
52         <listitem>
53           <para>Integer row vector.</para>
54         </listitem>
55       </varlistentry>
56     </variablelist>
57   </refsection>
58
59   <refsection>
60     <title>Description</title>
61
62     <para>Let <literal>s[k]</literal> stands for the <literal>k</literal>
63     character of string <literal>s</literal> ( or the white space character if
64     <literal>k &gt;length(s)</literal>).</para>
65
66     <para><literal>part</literal> returns <literal>strings_out</literal>, a
67     matrix of character strings, such that <literal>strings_out(i,j)</literal>
68     is the string <literal>"s[v(1)]...s[v(n)]"</literal> (
69     <literal>s=strings_in(i,j)</literal> ).</para>
70   </refsection>
71
72   <refsection>
73     <title>Examples</title>
74
75     <programlisting role="example"><![CDATA[ 
76 // returns characters position 8 to 11
77 part("How to use ""part"" ?",8:11)
78
79 // returns characters position 2 to 4 for each element
80 // no characters replaced by ''
81 c = part(['a','abc','abcd'],2:4)
82
83 // returns character position 1 for each element and add characters position 4 to 7 of each element
84 c = part(['abcdefg','hijklmn','opqrstu'],[1,4:7]);
85
86 // returns character 4 for each element, add characters position 1 to 7 and add character position 4 for each element
87 c = part(['abcdefg','hijklmn','opqrstu'],[4,1:7,4]);
88
89 // returns character position 1,add again character position 1 and character position 2
90 c=part(['a','abc','abcd'],[1,1,2])
91
92 // a a a  
93 part(['a','abc','abcd'],[1])
94
95 // aa aa aa 
96 part(['a','abc','abcd'],[1,1])
97
98 // aa aab aab 
99 part(['a','abc','abcd'],[1,1,2])
100  ]]></programlisting>
101   </refsection>
102
103   <refsection role="see also">
104 <title>See Also</title>
105
106     <simplelist type="inline">
107       <member><link linkend="string">string</link></member>
108
109       <member><link linkend="length">length</link></member>
110     </simplelist>
111   </refsection>
112 </refentry>