XtScript functions
substr
Return part of a string
Syntax
[var $... = ]call substr $val=…[;$start=…[;$length=…]][...] optional · ... your value
Notes
Returns the portion of a string specified by the $start and $length parameters.
If $start is negative, the returned string will begin at $start characters from the end of $val.
If $val is less than or equal to $start characters in length, FALSE will be returned.
Example
<!--parser:xtscript-->
var $string = abcdefghijklm
var $portion = call substr $val=$string; $start=4 ; $length=6
print string = $string<br />
print portion = $portion
<!--/parser:xtscript-->
Copy as text
string = abcdefghijklm
portion = efghij
Related