[Solved] Using sub to reduce length of text [closed]


sub(".*;\\s*", "", String)

Explanation:
.* – matches any number of characters at the beginning
; – matches the last ;
\s* – matches zero or more white-space characters after the ;

So the first expression matches everything up to the first non-blank character after the last ;. It is replaced with the empty string, so it just deletes everything at the beginning.

8

solved Using sub to reduce length of text [closed]