string trimright

Gives a string with given characters removed at the end.

string trimright STRING ?CHARS?

Description

Removes each character of the set CHARS from the end of STRING only. CHARS follows the rules of string trim.

Arguments

ArgumentTypeDefaultDescription
STRINGstringrequiredThe text to trim.
CHARSstringwhite spaceThe set of characters to remove.

Returns

The new string.

Examples

% string trimright "  a  "
  a

% string trimright 1.500 0
1.5

Errors

% string trimright
wrong # args: should be "string trimright string ?chars?"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also