Revert f56158b2 "[doc] string pages improved" for specific files where
[scilab.git] / scilab / modules / string / help / en_US / strncpy.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:db="http://docbook.org/ns/docbook"
18           xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="strncpy">
19     <refnamediv>
20         <refname>strncpy</refname>
21         <refpurpose>gets and gives the N first characters of the given strings</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>res = strncpy(str1, num)</synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>str1</term>
32                 <listitem>
33                     <para>
34                         a character string or matrix of character strings.
35                     </para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>num</term>
40                 <listitem>
41                     <para>
42                         an integer or a matrix of integers, maximum number of characters to be copied from source.
43                     </para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>res</term>
48                 <listitem>
49                     <para>
50                         a character string or matrix of character strings.
51                     </para>
52                 </listitem>
53             </varlistentry>
54         </variablelist>
55     </refsection>
56     <refsection>
57         <title>Description</title>
58         <para>
59             <code>res = strncpy(str1, num)</code> copies the first <varname>num</varname> characters of source <varname>str1</varname> to destination <varname>res</varname>.
60         </para>
61         <para>
62             <varname>num</varname> must have same dimensions than
63             <varname>str1</varname> or <varname>num</varname> must be an integer number.
64         </para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69 strncpy('scilab',3)
70 strncpy(['scilab','SciLab';'strncpy','strstr'],3)
71 strncpy(['scilab','SciLab';'strncpy','strstr'],[1,2;3,4])
72  ]]></programlisting>
73     </refsection>
74     <refsection role="see also">
75         <title>See also</title>
76         <simplelist type="inline">
77             <member>
78                 <link linkend="strcat">strcat</link>
79             </member>
80             <member>
81                 <link linkend="strcmp">strcmp</link>
82             </member>
83         </simplelist>
84     </refsection>
85 </refentry>