'abc1234'.chomp(4) # => 'abc123' 'toto'.chomp('to') # => 'to'
prices = [10, 20, 30, 40] prices.pop puts prices Output: [10, 20, 30]