Navigation :
trim
trim, function
def const pure trim(t: text, toTrim: text): text
Removes characters from both ends of t. The characters to remove are listed
in toTrim.
t: the text to trim.
toTrim: the set of characters to remove.
Example
const original = " Hello world! "
const trimmed1 = trim(original, " ")
const trimmed2 = trim(original, "! ")
show summary "Trim" with
strlen(original) as "Original"
strlen(trimmed1) as "Trimmed1"
strlen(trimmed2) as "Trimmed2"
This outputs the following summary:
| Original |
Trimmed1 |
Trimmed2 |
| 14 |
12 |
11 |