Skip to content
Prev 79959 / 398502 Next

getting last 2 charcters of a string, other "text" functions?

Note that this one can be slightly simplified by using sub instead of gsub
(since you only will have one match anyways) and the $ is not needed
since .* will consume the maximal matching string:

sub(".*(..)", "\\1", mystring)
On 10/31/05, Carlos J. Gil Bellosta <cgb at datanalytics.com> wrote: