Remove first character from Ruby string using [1..n]

ruby, ruby-on-rails

Solution

You can use negative indexes. This will offset them from the end. -1 is the last element, -2 is the second last and so on.

'.extension'[1..-1] # => extension

Problem

I'm trying to basically trying to remove the `.` in the the string `.extension` So I'm using ``` '.extension'[1..10] #gives extension ``` Of course this will work for 10 characters, how would I make it work for any length. I dont know what to search for because I dont know what this array style `[x..y]` is called.

Original source