>
> however, it is harder to get the last few characters of a String
>
> string[-8..-1] || string
>

You could try something like this.

str = "123456789"
p str[/.{1,8}\z/]

p str[/\A.{1,8}/]




Harry