From: Farrel Lifson Date: 2006-12-21T00:18:36+09:00 Subject: Re: tricky sort for happy visitors of Paris On 20/12/06, Josselin wrote: > all happy visitors of Paris know about the 'arrondissement', an > administrative division of the city... 20 divisions > > selecting them from a city table I can map them as : > > ['Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' , > 'Paris 20' , 'Paris 3' , .... 'Paris 9' ] > > is there any way to sort this array and get : > > ['Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' , > 'Paris 11' , ..... 'Paris 19' , 'Paris 20' ] > > which seems betetr in a list... ;-)) > > thanks for your light > > joss > > > ["Paris 1","Paris 10","Paris 2"].sort_by{|a| a.split[1].to_i} Farrel