Top index Wirbel home

::trimToLast

string.trimToLast(stopper) - remove prefix from string up to last occurance of stopper

string.trimToLast(stopper) scans astring from the right for stopper, which can be a string or a single character. If found, it removes everything from the beginning upto and including the rightmost occurance of stopper and returns the rest. If stopper is not found, astring itself returned. astring is not modified.

Examples

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

See also

trimFrom, trimFromFirst, trimTo