Ruby, remove last N characters from a string

rubystring

What is the preferred way of removing the last n characters from a string?

Best Solution

irb> 'now is the time'[0...-4]
=> "now is the "