XtScript functions
strrchr
Find the last occurrence of a character in a string
Syntax
[var $... = ]call strrchr $haystack=…;$needle=…[...] optional · ... your value
Notes
Returns the part of the $haystack starting at the last occurrence of the $needle until the end of the $haystack
Example
<!--parser:xtscript-->
var $haystack = abcdefghijklm
var $needle = g
var $portion = call strrchr $haystack=$haystack; $needle=$needle
print haystack = $haystack<br />
print needle = $needle<br />
print portion = $portion
<!--/parser:xtscript-->
Copy as text
haystack = abcdefghijklm
needle = g
portion = ghijklm
Related