Monday, November 4, 2013

Ruby: How to delete a key from the hash


Share at Facebook

You can delete a key by using the delete function of the hash. Here is the example:


hash = {'a' => '1', '1' => 'a'}
puts hash
hash.delete('1')
puts hash






No comments: