From: Michael Neumann Date: 2004-08-01T16:56:47+09:00 Subject: Re: [RCR] natcmp.rb added to string class Patrick May wrote: > Hello, > > Natural Order String Comparison is a useful algorithm: > > http://sourcefrog.net/projects/natsort/ > > Alan Davies wrote an implementation of the algorithm in ruby, and it is > useful: > > http://sourcefrog.net/projects/natsort/natcmp.rb > > I think it would be nice if String always had this method. I hope there > aren't license conflicts. Hm, I think it's good to have this as an external library. This could then extend both String and Array classes. E.g. require 'natsort' ["a10", "a2"].sort {|a,b| a.natcmp(b) } # or ["a10", "a2"].natsort Regards, Michael