Revert f56158b2 "[doc] string pages improved" for specific files where
[scilab.git] / scilab / modules / string / help / en_US / strstr.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2020 - Samuel GOUGEON
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:ns4="http://www.w3.org/1999/xhtml"
18           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19           xml:id="strstr" xml:lang="en">
20     <refnamediv>
21         <refname>strstr</refname>
22         <refpurpose>
23           Tail of a string starting from the 1st occurrrence of a given fragment
24         </refpurpose>
25     </refnamediv>
26     <refsynopsisdiv>
27         <title>Syntax</title>
28         <synopsis>Tail = strstr(Strings, StartingFragment)</synopsis>
29     </refsynopsisdiv>
30     <refsection>
31         <title>Arguments</title>
32         <variablelist>
33             <varlistentry>
34                 <term>Strings, StartingFragment, Tail</term>
35                 <listitem>
36                     <para>
37                         Matrices of strings, of identical dimensions.
38                        <varname>StartingFragments</varname> can be a single string. It is then used
39                        for all <varname>Strings</varname> components.
40                     </para>
41                 </listitem>
42             </varlistentry>
43         </variablelist>
44     </refsection>
45     <refsection>
46         <title>Description</title>
47         <para>
48             <literal>Tail = strstr(Strings, StartingFragment)</literal> builds and returns a matrix
49             of strings such that, for each element <literal>Strings(i)</literal>, <literal>Tail(i)</literal>
50             is the part of <literal>Strings(i)</literal> starting from the first occurrence of
51             <literal>startingFragment(i)</literal>, up to the end of <literal>Strings(i)</literal>.
52         </para>
53         <para>
54             If <varname>StartingFragment(i)</varname> is not found in <literal>Strings(i)</literal>,
55             <literal>Tail(i)</literal> is set to <literal>""</literal>.
56         </para>
57     </refsection>
58     <refsection>
59         <title>Examples</title>
60         <programlisting role="example"><![CDATA[
61 strstr('This is a simple string','simple')
62 strstr('This is a simple string','sample')
63 strstr(['This is a simple string','in scilab'],'is')
64 strstr(['This is a sample string','in scilab'],['a','scilab'])
65  ]]></programlisting>
66     </refsection>
67     <refsection role="see also">
68         <title>See also</title>
69         <simplelist type="inline">
70             <member>
71                 <link linkend="strrchr">strrchr</link>
72             </member>
73             <member>
74                 <link linkend="strchr">strchr</link>
75             </member>
76         </simplelist>
77     </refsection>
78 </refentry>