To get the last n characters from a string, you could do this
a[-n, n] if a is the array.
Here's and example if you would want one.
ruby-1.9.2-p180 :006 > a = "911234567890"
=> "911234567890"
ruby-1.9.2-p180 :009 > a[-5,5]
=> "67890"
ruby-1.9.2-p180 :010 > a[-7,7]
=> "4567890"