trimRight

trimRight, function

def const pure trimRight(t: text, toTrim: text): text

Removes characters from the end of t. The characters to remove are listed in toTrim.

Examples

trimRight(" # abcde### ", " #") returns " # abcde".

trimRight(" # abcde### ", " ") returns " # abcde###".

trimRight(" # abcde### ", "") returns " # abcde### ".

Remarks

The toTrim argument is interpreted as a set of characters, not as a suffix. All trailing characters found in that set are removed until the first character that is not in the set.

See also

User Contributed Notes
0 notes + add a note