|
| | Subject: | Delete every other value in an array | | Group: | Ruby-talk | | From: | Tim Conner | | Date: | 9 May 2008 |
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
--
Posted via http://www.ruby-forum.com/.
|