trim
Remove whitespace (or other characters) from the beginning and end of a string
[...] = optional ... = your value
[var $... = ]call trim $val=…[;$charlist=…]
Example code
Show in textarea<!--parser:xtscript-->
#assign a space to a variable
var $space =call chr $val=32
var $input =xyz FOOBAR zyx
var $input =$space$input$space
# default trim
var $output = call trim $val=$input
print default trim<br />
print input =|$input|<br />
print output =|$output|<br /><br />
# a space can be added (not at the end) as a part of a $charlist of 2 or more characters
var $output = call trim $val=$input ; $charlist=xy z
print a space in the charlist<br />
print input = |$input|<br />
print output = |$output|<br /><br />
# specify a range of characters with ..
var $input = ABCDEFGHIJKLMABCDEF
var $output = call trim $val=$input ; $charlist= A..F J..M
print trim a range of characters<br />
print input = $input<br />
print output = $output
<!--/parser:xtscript-->
Show in textarea Example output
Reloaddefault trim
input =| xyz FOOBAR zyx |
output =|xyz FOOBAR zyx|
a space in the charlist
input = | xyz FOOBAR zyx |
output = |FOOBAR|
trim a range of characters
input = ABCDEFGHIJKLMABCDEF
output = GHI