Delphi TStringList 排序 CustomSort


本文整理自网络,侵删。

 

function Compare(List: TStringList; Index1, Index2: Integer): Integer;
var
  S1, S2: string;
begin
  S1 := List[Index1].Substring(0,11);
  S2 := List[Index2].Substring(0, 11);
  Result := CompareStr(S1, S2);
end;

//排序
var
sl: TStringList;
sl.CustomSort(LogLineCompare);

相关阅读 >>

Delphi 遍历类中的属性

Delphi 如何从dll中检索导出函数的列表

Delphi 读取文件获取指定字符串

Delphi 获取鼠标当前位置的相对坐标

线程池的概念

Delphi 10.4.1的编译器bug终于修正了!

封装Delphi hook api

Delphi controls 属性与继承 tshape 类的小练习

Delphi中启用禁止cd驱动器自动运行播放

Delphi 10 firedac 连接池设置

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



打赏

取消

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

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

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

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

评论

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