NaturalSort

From Lazarus wiki
Revision as of 20:35, 25 May 2015 by Antoniogalvao (talk | contribs) (Created page with "{{Translate}} = About = Natural sort order is an ordering of strings in alphabetical order, except that multi-digit numbers are ordered as a single character. Natural sort or...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Template:Translate

About

Natural sort order is an ordering of strings in alphabetical order, except that multi-digit numbers are ordered as a single character. Natural sort order has been promoted as being more human-friendly ("natural") than the machine-oriented pure alphabetical order.

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

Functionality to sort by natural sort order is built into many progamming languages and libraries.

Authors

Antônio Galvão and Rik van Kekem

Platforms

Linux and Windows.

Download

The latest version is available here: http://sourceforge.net/projects/lazarusfiles/files/naturalsort.zip/download

Functions and Procedures

procedure NaturalSort(aList: TStrings);

function UTF8NaturalCompareList(aList: TStringList; Index1, Index2: Integer): Integer;

function UTF8LogicalCompareText(const S1, S2: string): Integer;

function UTF8NaturalCompareText(const S1, S2: string): Integer;