From: koichirose Date: 2008-05-26T05:54:33+09:00 Subject: Re: A simple newbie question (arrays and strings) yermej wrote: > unique_array = Dir.entries('.')[2..-1].map {|f| f.split('-')[0]}.uniq > string.map! {|f| f.split('-')[0]}.uniq! What if I do: Dir.entries('.')[2..-1].map! {|f| f.split('-')[0]}.uniq with map! instead of map ? I'd now have Dir.entries trimmed, splitted and "uniqed" ? Thanks