Deleting Hash Elements : delete « Hash « Ruby






Deleting Hash Elements


x = { "a" => 1, "b" => 2 }
x.delete("a")
puts x.inspect

 








Related examples in the same category

1.Delete element from hash
2.Deleting and Clearing a Hash
3.pass a block to your call to delete.