Bug 12836 fixed: There was an error in strcmpi documentation
[scilab.git] / scilab / modules / string / help / en_US / strcmp.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: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="strcmp" xml:lang="en">
14     <refnamediv>
15         <refname>strcmp</refname>
16         <refpurpose>compare character strings</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>res = strcmp(string_one, string_two, ['i'])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>string_one</term>
27                 <listitem>
28                     <para>
29                         a character string or matrix of character strings.
30                     </para>
31                 </listitem>
32             </varlistentry>
33             <varlistentry>
34                 <term>string_two</term>
35                 <listitem>
36                     <para>
37                         a character string or matrix of character strings.
38                     </para>
39                 </listitem>
40             </varlistentry>
41             <varlistentry>
42                 <term>'i'</term>
43                 <listitem>
44                     <para>
45                         an optional parameter to do <function>strcmpi</function>
46                         (case independent), default value is <literal>'s'</literal>.
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>res</term>
52                 <listitem>
53                     <para>a matrix of integers.</para>
54                 </listitem>
55             </varlistentry>
56         </variablelist>
57     </refsection>
58     <refsection>
59         <title>Description</title>
60         <para>
61             <code>res = strcmp(string_one, string_two)</code> (or
62             <code>res = strcmp(string_one, string_two, 's')</code>) returns an
63             integral value indicating the relationship between the strings.
64         </para>
65         <para>
66             The value greater than zero indicates that the first character that
67             does not match has a greater value in <varname>string_one</varname>
68             than in <varname>string_two</varname> and the value less than zero
69             indicates the opposite (lexicographical order).
70         </para>
71         <para>
72             The value equal zero indicates that <varname>string_one</varname>
73             and <varname>string_two</varname> are equal.
74         </para>
75         <para>
76             <code>res = strcmp(string_one, string_two, 'i')</code> returns
77             <literal>0</literal> if <varname>string_one</varname> is equal to
78             <varname>string_two</varname> (case independently) and
79             <literal>1</literal> indicates the opposite.
80         </para>
81     </refsection>
82     <refsection>
83         <title>Examples</title>
84         <programlisting role="example"><![CDATA[ 
85 TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];
86 TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];
87 strcmp(TXT1,TXT2)
88 strcmp(TXT1,'scilab')
89 strcmp(TXT1,'SciLab')
90 strcmp(TXT1,TXT2,'i')
91 strcmp(TXT1,TXT2,'s')
92     ]]></programlisting>
93     </refsection>
94     <refsection role="see also">
95         <title>See Also</title>
96         <simplelist type="inline">
97             <member>
98                 <link linkend="strcat">strcat</link>
99             </member>
100             <member>
101                 <link linkend="strcmpi">strcmpi</link>
102             </member>
103         </simplelist>
104     </refsection>
105 </refentry>