From: Estanislau Trepat Date: 2011-02-15T19:04:05+09:00 Subject: Re: Hash sanitization from query - newbie --000e0ce0ad1e4d372b049c4f47f5 Content-Type: text/plain; charset=UTF-8 Maybe I misunderstand what you are trying to do here, but what about something like: studies = [[148,"Uneducated"],[135,"Highschool"],[272,"Some college"],[141,"University"],[143,"Post-grad"],[144,"PhD"],[141,"other"],[8,"Post-doc"]] studies.map(&:reverse) => [["Uneducated", 148], ["Highschool", 135], ["Some college", 272], ["University", 141], ["Post-grad", 143], ["PhD", 144], ["other", 141], ["Post-doc", 8]] -- Estanislau Trepat http://etrepat.com http://twitter.com/etrepat 2011/2/15 Sem Ptiri > If I have the following: > > [[148,"Uneducated"],[135,"Highschool"],[272,"Some > > college"],[141,"University"],[143,"Post-grad"],[144,"PhD"],[141,"other"],[8,"Post-doc"]] > > is there an function to invert/swap the numbers with strings? > > -- > Posted via http://www.ruby-forum.com/. > > --000e0ce0ad1e4d372b049c4f47f5--