STRING::RTRIM 1g 2023-11-12 laplante@plcb.ca GOWEB/STRING — Trim Characters from the Right


title: “STRING::RTRIM” version: “1.0.0” date: 2023-11-12 author: “laplante@plcb.ca” section: “1g”

category: “GOWEB/STRING”

Name

string::rtrim Trim Characters from the Right

Synopsis

string::rtrim(expression[, cutset: string])
rtrim(expression[, cutset: string])

Description

The rtrim function trims characters from the right (end) of a string based on the specified cutset.


Examples

res={{
    rtrim("hello           "); "\n";
    rtrim("               Pierre Laplante                 "); "\n";
    a := "abc\n\n";
    rtrim(a); "\n";
    a = "3223987diufhwrifuh23892938472";
    rtrim(a, cutset:"1234567890"); "\n";
    a = [ "a ", "b\n", "c\t", "d\v"];
    b := "abc ";
    rtrim(a,b); "\n";
}}.

Returns:

res=hello
               Pierre Laplante
abc
3223987diufhwrifuh
[["a","b","c","d"],"abc"]

Author

laplante@plcb.ca

See Also


Version