ruby lepaskan elemen terakhir string

'abc1234'.chomp(4) # => 'abc123'
'toto'.chomp('to') # => 'to'
Lioruby