DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Using Delete_at In Ruby

02.12.2010
| 3204 views |
  • submit to reddit
        Source: <a href="http://ruby-doc.org/core/classes/Array.html#M002194">Class: Array</a> [ruby-doc.org]
a = %w( ant bat cat dog )
a.delete_at(2)    #=> "cat"
a                 #=> ["ant", "bat", "dog"]