STRING::RTRIM
1g 2023-11-12 laplante@plcb.ca GOWEB/STRING — Trim Characters from the Righttitle: “STRING::RTRIM” version: “1.0.0” date: 2023-11-12 author: “laplante@plcb.ca” section: “1g”
string::rtrim Trim Characters from the Right
string::rtrim(expression[, cutset: string])
rtrim(expression[, cutset: string])
The rtrim
function trims characters from the right (end) of a string based on the specified cutset
.
cutset
— The set of characters to remove from the right." \t\n\v"
(space, tab, newline, vertical tab).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"]
laplante@plcb.ca