trim. Trimming letters

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

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

It can also be specified, which letters 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–2010 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 04.07.2008