Answers for "how to remove element from array in ruby"

1

ruby array remove by index

a= [1,1,1,2,2,3]
delete_list = [1,3]
delete_list.each do |del|
    a.delete_at(a.index(del))
end
Posted by: Guest on January-20-2021

Code answers related to "how to remove element from array in ruby"

Browse Popular Code Answers by Language