From: Matthew Moss Date: 2006-01-07T11:00:33+09:00 Subject: Re: Splitting strings on spaces, unless inside quotes > (0...sa.size).to_a.zip(sa).collect { |i,x| (i&1).zero? ? x.split : x }.flatten Just realized that Range responds to zip, so the to_a is unnecessary. This looks slightly cleaner to me: (1..sa.size).zip(sa).collect { |i,x| (i&1).zero? ? x : x.split }.flatten