From: Joel VanderWerf Date: 2010-06-11T04:45:44+09:00 Subject: Re: Split an array of object by first letter Greg Ma wrote: > Hi, > I have an array of brands and I need to split this array by brand name > first letter. How can I do that? ["fz", "yt", "fu", "za", "zw", "yo", "zb"].group_by {|s|s[0,1]} => {"y"=>["yt", "yo"], "z"=>["za", "zw", "zb"], "f"=>["fz", "fu"]}