Possible Duplicate:
Odd ( or even ) entries in a Ruby array
Suppose i have a following array
arr = ["Value0","Value1","Value2","Value3","Value4","Value5","Value6","Value7","Value8"]
I want to delete the alternate element such that my o/p array will something like following
["Value0", "Value2", "Value4", "Value6", "Value8"]
i.e it should delete the elements at the odd position.
I don’t feel it is the fastest way but you could do
or