From: w_a_x_man Date: 2010-12-28T03:20:18+09:00 Subject: Re: array index inside map function On Dec 27, 4:42 am, Robert Klemme wrote: > On Sun, Dec 26, 2010 at 10:13 AM, Siddharth Venkatesan > > wrote: > > All of the three solution taught me something. I think i'll go with > > .map.with_index. That looks concise. > > Frankly, I would do something different: > > input = "101010,234,876" > # ... > junk, a, b, *remainder = input.split ',' > > get_something a > get_something b > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without endhttp://blog.rubybestpractices.com/ "101010,234,876".split(",").drop(1).map{|c| get_something(c)}