Answers for "how to remove the first element in an array ruby"

0

ruby delete first element of array

a = [0,1,2,3]

a.drop(1)
# => [1, 2, 3] 

a
# => [0,1,2,3]
Posted by: Guest on March-14-2021
0

how to remove the first element in an array ruby

a = [0,1,2,3]

a.shift
# => [1,2,3]

a
# => [1,2,3]
Posted by: Guest on February-02-2022

Code answers related to "how to remove the first element in an array ruby"

Browse Popular Code Answers by Language