<strstr $needle $haystack [$mode]>
<strstri $needle $haystack [$mode]>
strstr function finds the first occurrence of each
$needle value in each
$mode argument is a
(here) compare mode to use; the default
is the current apicp stringcomparemode, with "
$mode values are used in the
same order as
$haystack values. The
was added in version 6.
strstri return N*H values (N
and H being the number of values in
$haystack), i.e. there is exactly one return value for each
$haystack combination. Each return value is the
character index into the
$haystack value where the
$needle value was first found (0 for first
character), or -1 if the
$needle value was not found. The
first N return values are for the first
$needle order), the next N return values are for the
$haystack value, etc.
$mode is a
<$haystack = "This is a test." "Is that?" "My island.">
<strstr "is" $haystack>
The return values in
$ret would be 2, -1 and 3.
Note that the arguments to
strstr are in opposite order from
C version. The
were added Feb. 5 1997.
Note that the offsets returned are character-based, not byte-based.
For byte offsets, ensure
iso-8859-1 is part of
+iso-8859-1), as character offsets in ISO-8859-1 are
always the same as byte offsets - unlike the default UTF-8-based mode.
Text is compared according to apicp stringcomparemode (with
strstri), or the