Natural sort order

Natural sort order is an ordering of strings in alphabetical order, except that multi-digit numbers are treated atomically, i.e., as if they were a single character. Natural sort order has been promoted as being more human-friendly ("natural") than the machine-oriented pure alphabetical order.[1]

For example, in alphabetical sorting "z11" would be sorted before "z2" because "1" is sorted as smaller than "2", while in natural sorting "z2" is sorted before "z11" because "2" is sorted as smaller than "11".

Alphabetical sorting:

  1. z11
  2. z2

Natural sorting:

  1. z2
  2. z11

The Natural Order Mac OS System Extension was conceived and implemented overnight on-site as an entry for the Best Hack contest during the 1996 MacHack conference in Dearborn, Michigan.[2][3]

Dave Koelle wrote the Alphanum Algorithm in 1997[4] and Martin Pool published Natural Order String Comparison in 2000.[5]

Functionality to sort by natural sort order is now widely available in software libraries for many programming languages.[6][7][8][9][10]

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.