Delphi 取字符串中间

2022-11-10 16:25:44 作者:admin

本文整理自网络,侵删。

 function GetMidString(s: string; d: string; c: string): string; // 取字符串中间var  i, n: Integer;begin  try    i := pos(d, s);    n := pos(c, copy(s, i + 1, Length(s) - i));    Result := copy(s, i + Length(d), n - Length(d));  except    Result := '';  end;end;

{
  "access_token": "1.a6b7dbd428f731035f771b8d********.86400.1292922000-2346678-124328",
    "expires_in": 2592000,
    "refresh_token": "2.385d55f8615fdfd9edb7c4b********.604800.1293440400-2346678-124328",
    "scope": "public audio_tts_post ...",
    "session_key": "ANXxSNjwQDugf8615Onqeik********CdlLxn",
    "session_secret": "248APxvxjCZ0VEC********aK4oZExMB",
}

str:=' "access_token": "1.a6b7dbd428f731035f771b8d********.86400.1292922000-2346678-124328",'
//用法 tok :=GetMidString(str,'access_token":"','",');

相关阅读 >>

Delphi datasnap stream 传递大数据

Delphi qq尾巴病毒的编写

Delphi xe5、6、7在android或者ios上使用ansistring和ansichar

Delphi中读写txt文件的一段代码

Delphi的字符串与16进制的相互转换函数的汇编代码

vclzip控件显示压缩进度

Delphi版多开源码,也就是遍历系统内核对象句柄

Delphi 软件welcome窗口代码

Delphi 文件,文件夹删除移动和拷贝

Delphi 与 xml 示例(直接利用ixmldocument)

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



在线咨询 拨打电话