delphi 去除 TStringList 重复项


本文整理自网络,侵删。

 
//去除 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用mapfileandchecksum 函数检测 exe 或 dll 是否被修改

Delphi winsock downloader

Delphi通过loadlibrary调用其他动态库

Delphi 在减少占用资源的情况下,等待msecs毫秒

Delphi复制文件夹内所有文件

Delphi tstream详解

Delphi tcolortohex 与 hextotcolor

Delphi实现音频传输

Delphi 传输文件例子的核心代码

Delphi xe android的所有权限按照分类总结说明

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...