本文整理自网络,侵删。
//去除 TStringList 重复项procedure RemoveDuplicates(const AStrs: TStringList);var Buf: TStringList; Idx: Integer;begin AStrs.Sort; Buf := TStringList.Create; try Buf.Sorted := True; Buf.Duplicates := dupIgnore; Buf.BeginUpdate; for Idx := 0 to AStrs.Count - 1 do begin Buf.Add(AStrs[Idx]) ; end; Buf.EndUpdate; AStrs.Assign(Buf) ; finally FreeandNil(Buf) ; end;end;
http://www.delphifmx.com/node/29
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>