Top index Wirbel home

::trimFrom

string.trimFrom(stopper) - remove suffix from string beginning at last occurance of stopper

string.trimFrom(stopper) scans astring from the right for stopper, which can be a string or a single character. If found, it returns a copy of astring with everything from the rightmost occurance of stopper upto the end of astring removed. If stopper is not found, astring itself returned. astring is not modified.

Examples

 "hello merry world".trimFrom(' ') == "hello merry"
 "one::two::three".trimToFrom("::") == "one::two"

See also

trimFromFirst, trimTo, trimToLast