dogweather / naturally

Natural sort algorithm
MIT License
87 stars 20 forks source link

Case Insensitive Sorting #18

Open evanlemke opened 9 years ago

evanlemke commented 9 years ago

Would it be possible to add a flag that allows for case case insensitive sorting

aried3r commented 8 years ago

I'd also be interested in this.

Kris-LIBIS commented 8 years ago

You can do that:

Naturally.sort_by_block(list) { |x| x.downcase }

aried3r commented 7 years ago

@Kris-LIBIS, thanks. I'm already using code similar to the one you proposed, but I think I should have been more clear. Ideally I want this to be guaranteed to be a stable sort and integrated into this gem.

But thinking about it, I might have to test this myself if this isn't already the case (and there's the subjective (?) question about how case insensitive sorting should work).

Anyway, thanks for your reply!