STRING::TRIMSUFFIX 1g 2024-11-11 laplante@plcb.ca GOWEB/STRING — Remove a Suffix from a Stringtitle: “STRING::TRIMSUFFIX” version: “1.0.0” date: 2024-11-11 author: “laplante@plcb.ca” section: “1g”
string::trimSuffix Remove a Suffix from a String
string::trimSuffix(str, suffix[, error: variable])
trimSuffix(str, suffix[, error: variable])
The trimSuffix function returns the given string str without the specified trailing suffix.
str does not end with suffix, it is returned unchanged.error parameter to capture errors.error — variable to capture error details.res={{
s := "/a/b/c/IMG.mp4";
b := base(s);
trimSuffix(b, extension(s));
}}.
Returns:
IMG
laplante@plcb.ca