Delphi 根据分割符只取最后的值


本文整理自网络,侵删。

 
function GetCharStr(charstr:Char;str: string): string;
var ts : TStrings;
begin

  ts := TStringList.create;
  try
    ts.Delimiter :=charstr;
    ts.DelimitedText := str;
    if ts.Count > 0 then
      Result := ts[ts.Count - 1]; //这里控制取值
  finally
    ts.Free;
  end;
end;

相关阅读 >>

Delphi 利用unigui中的tunipagecontrol实现多页面

Delphi实现屏幕截图、窗口截图、指定区域截图

Delphi之完美splash方案

Delphi httpencode

Delphi 删除确认对话框

Delphi x秒生成大量垃圾字符

Delphi 的运算符重载

Delphi2007-Delphi2010 程序不出现在任务栏的方法

Delphi 用拼音首字符检索汉字的源代码

Delphi使用xmlhttp获取时间

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



打赏

取消

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

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

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

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

评论

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