logo
Home XtGem- Templates- XtScript- bottom
Find the last occurrence of a character in a string
[...] = optional ... = your value
[var $... = ]call strrchr $haystack=…;$needle=…
Returns the part of the $haystack starting at the last occurrence of the $needle until the end of the $haystack
Show in textarea
<!--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-->
Show in textarea
Reload
haystack = abcdefghijklm
needle = g
portion = ghijklm
Powered by XtGem
About us Contact Forum top