//remove duplicate strings from the string list
procedure RemoveDuplicates(const stringList : TStringList) ;
var
buffer: TStringList;
cnt: Integer;
begin
stringList.Sort;
buffer := TStringList.Create;
try
buffer.Sorted := True;
buffer.Duplicates := dupIgnore; //这个表示的是重复荐删除。
buffer.BeginUpdate;
for cnt := 0 to stringList.Count - 1 do
buffer.Add(stringList[cnt]) ;
buffer.EndUpdate;
stringList.Assign(buffer) ;
finally
FreeandNil(buffer) ;
end;
end;
浙公网安备 33010602011771号