Revert f56158b2 "[doc] string pages improved" for specific files where
[scilab.git] / scilab / modules / string / help / en_US / strchr.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" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xml:lang="en" xml:id="strchr">
17     <refnamediv>
18         <refname>strchr</refname>
19         <refpurpose>
20             find the first occurrence of a character in a string
21         </refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>res = strchr(haystack, char)</synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>haystack</term>
32                 <listitem>
33                     <para>
34                         a character string or matrix of character strings.
35                     </para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>char</term>
40                 <listitem>
41                     <para>a character.</para>
42                 </listitem>
43             </varlistentry>
44             <varlistentry>
45                 <term>res</term>
46                 <listitem>
47                     <para>
48                         a character string or matrix of character strings.
49                     </para>
50                 </listitem>
51             </varlistentry>
52         </variablelist>
53     </refsection>
54     <refsection>
55         <title>Description</title>
56         <para>
57             <code>res = strchr(haystack, char)</code> returns the first
58             occurrence of character in the string <varname>haystack</varname>.
59         </para>
60         <para>
61             <varname>char</varname> must contain only one string or as many
62             strings as in <varname>haystack</varname> (each one being one-
63             character-long).
64         </para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69 strchr('This is a sample string','s')
70 strchr(['This is a sample string','in scilab'],'s')
71 strchr(['This is a sample string','in scilab'],['s','a'])
72     ]]></programlisting>
73     </refsection>
74     <refsection role="see also">
75         <title>See also</title>
76         <simplelist type="inline">
77             <member>
78                 <link linkend="strrchr">strrchr</link>
79             </member>
80             <member>
81                 <link linkend="strstr">strstr</link>
82             </member>
83         </simplelist>
84     </refsection>
85 </refentry>