strstr
Returns all of $haystack starting from and including the first occurrence of $needle to the end.
[...] = optional ... = your value
[var $... = ]call strstr $haystack=…;$needle=…[;$before_needle=…]
Notes
Returns the part of $haystack starting from and including the first occurrence of $needle to the end of $haystack
If $before_needle=1 the function returns the part of $haystack before the first occurrence of $needle (excluding $needle)
Example code
<!--parser:xtscript-->
var $haystack = abcdefghijklm
var $needle = g
var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=1 ;
print haystack = $haystack<br />
print needle = $needle<br />
print position = $position<hr />
var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=0 ;
print haystack = $haystack<br />
print needle = $needle<br />
print position = $position
<!--/parser:xtscript-->
Show in textareaExample output
Reloadhaystack = abcdefghijklm
needle = g
position = abcdef
haystack = abcdefghijklm
needle = g
position = ghijklm