Answers for "ruby remove last element of array"

1

ruby pop array

a = [1, 2, 3, 4]
a.pop()
# => 4
Posted by: Guest on June-17-2020
0

ruby remove last element of string

'abc1234'.chomp(4) # => 'abc123'
'toto'.chomp('to') # => 'to'
Posted by: Guest on March-03-2021

Code answers related to "ruby remove last element of array"

Browse Popular Code Answers by Language