From: Jamey Cribbs Date: 2006-12-21T00:19:40+09:00 Subject: Re: tricky sort for happy visitors of Paris 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' ] arrondissement_arr.sort_by { |a| a.split.last.to_i } Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.