trim. Trimming letters

^string.trim[]
^st
ring.trim[from]
^st
ring.trim[from;set]
^string.trim[set]   [3.4.4]

The methods trims any characters from
set the beginning and the end of the string. By default it trims white space characters.
It can be specified, where to trim letters
from, by passing one of the values:
·both-trim from either the beginning or the end;  
·left or start-trim from the beginning;  
·right or end-trim from the end.  

Parameter set specifies which characters to trim.

Example: white space trimming
$name[ Bob ]
"$name"
"^name.trim[]"

Will output…
" Bob "
"
Bob"

Example: trimming custom letters
$path[/section/subsection/]
^path.trim[
right;/]

Will output…
/section/subsection


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 04.04.2016