How can I get a substring from position N to the last char in Ruby 1.8.7?

Only Bolivian Here picture Only Bolivian Here · May 10, 2011 · Viewed 35.6k times · Source

I'd like to get a substring from a string from position N to the end of the string.

What's the way to do it in Ruby?

Answer

Sophie Alpert picture Sophie Alpert · May 10, 2011

Just slice the string like:

string[N..-1]