1 <?xml version="1.0" encoding="UTF-8"?>
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
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.
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">
21 <refname>strstr</refname>
23 Tail of a string starting from the 1st occurrrence of a given fragment
28 <synopsis>Tail = strstr(Strings, StartingFragment)</synopsis>
31 <title>Arguments</title>
34 <term>Strings, StartingFragment, Tail</term>
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.
46 <title>Description</title>
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>.
54 If <varname>StartingFragment(i)</varname> is not found in <literal>Strings(i)</literal>,
55 <literal>Tail(i)</literal> is set to <literal>""</literal>.
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'])
67 <refsection role="see also">
68 <title>See also</title>
69 <simplelist type="inline">
71 <link linkend="strrchr">strrchr</link>
74 <link linkend="strchr">strchr</link>