Difference between revisions of "TStringList.Sort"
(new page) |
(No difference)
|
Latest revision as of 15:50, 23 August 2013
procedure Sort()
Description
This function will sort strings in TStringList alphabetically.
Note that this doesn't set Sorted to TRUE, so if you plan to add more strings and don't want to break the sorting, you have to set it to TRUE manually.
Example
var
s: TStringList;
begin
s := File.CreateStringList();
s.Append('d');
s.Append('a');
s.Append('c');
s.Append('ca');
s.Append('b');
WriteLn(s.CommaText);
// d,a,c,ca,b
s.Sort();
WriteLn(s.CommaText);
// a,b,c,ca,d
s.Free;
end.