Top index Wirbel home

::trimFromFirst

string.trimFromFirst(stopper) - remove suffix from string beginning at first occurance of stopper

string.trimFromFirst(stopper) scans astring from the left for stopper, which can be a string or a single character. If found, it returns a copy of astring with everything from the leftmost 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".trimFromFirst(' ') == "hello"
 "one::two::three".trimToFromFirst("::") == "one"

See also

trimFrom, trimTo, trimToLast