Natural sort order
   HOME

TheInfoList



OR:

In computing, natural sort order (or natural sorting) is the ordering of strings in
alphabetical order Alphabetical order is a system whereby character strings are placed in order based on the position of the characters in the conventional ordering of an alphabet. It is one of the methods of collation. In mathematics, a lexicographical order is ...
, except that single- and multi-digit numbers are treated atomically, i.e., as if they were a single character, and compared between themselves by their actual numerical values. Natural sort order has been promoted as being more human-friendly ("natural") than machine-oriented, pure alphabetical sort order. For example, in alphabetical sorting, "z11" would be sorted before "z2" because the "1" in the first
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
is sorted as smaller than "2", while in natural sorting "z2" is sorted before "z11" because "2" is treated as smaller than "11". Alphabetical sorting: # z11 # z2 Natural sorting: # z2 # z11 Functionality to sort by natural sort order is now widely available in software libraries for many programming languages. During the 1996 MacHack conference, the Natural Order
Mac OS Mac operating systems were developed by Apple Inc. in a succession of two major series. In 1984, Apple debuted the operating system that is now known as the classic Mac OS with its release of the original Macintosh System Software. The system ...
System Extension was conceived and implemented overnight on-site as an entry for the Best Hack contest. Dave Koelle wrote the Alphanum Algorithm in 1997 and Martin Pool published Natural Order String Comparison in 2000.


References

{{reflist Collation