Delphi 截取字符串的用法


本文整理自网络,侵删。

 
function Parse(text, sol, sag: string): String;
begin
  Delete(text, 1, Pos(sol, text) + Length(sol) - 1);
  Result := Copy(text, 1, Pos(sag, text) - 1);
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
Caption:=Parse('123456789','12','89');     //结果 34567
end;

相关阅读 >>

Delphi 分割字符串 extractstrings

Delphi ttask无法传递参数的一个解决方案

Delphi 数据集转换json对象

Delphi firemonkey 图片显示拉伸不变形

Delphi winapi: getclassname - 获取指定窗口的类名

Delphi 调用批处理

tmsweb core 组件居中显示

Delphi中ado异步执行方式

winapi 字符及字符串函数(6): ischaralphanumeric - 是否是个文字(字母或数字)

Delphi中使用goo.gl(google的缩短url服务)api

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



打赏

取消

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

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

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

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

评论

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