Tim Conner wrote:

> What is the best way to delete every other value in a ruby array?
> e.g.
> %w(a b c d e f g h i j k)
> 
> becomes => [a c e g i k]
> 
> thanks

irb(main):001:0> a = ("a".."z").to_a
=>
["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
irb(main):002:0> for i in 1..a.size/2
irb(main):003:1> a.delete_at(i)
irb(main):004:1> end
=> 1..13
irb(main):005:0> a
=> ["a", "c", "e", "g", "i", "k", "m", "o", "q", "s", "u", "w", "y"]
irb(main):006:0>