Search code examples
rubystringsubstring

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


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?


Solution

  • Just slice the string like:

    string[N..-1]