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 wm_copydata的应用

Delphi用ado操作数据库完整示例

Delphi发送邮件―中文显示为乱码解决

Delphi操作unicode字符

Delphi 获取闪盘列表

Delphi xe10 手机内部系统相关操作(手机信息、震动、剪贴板、键盘、电话、拨号)

Delphi firedac 下的 sqlite [12] - 备忘录

Delphi 公历到农历的转换法

Delphi 取整算法集合

Delphi xe android/ios 实现图片放大缩小的两种方法

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



打赏

取消

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

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

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

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

评论

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