获取子字符串函数MidStr

MidStr返回指定范围内的字符串。该函数有三个参数。第一个参数为源字符串,第二个参数为起点(下标从1开始),第三个参数为结束点。通过第二、第三个参数则可指定要复制字符串的范围。

function MidStr(const AText: string; const AStart, ACount: Integer):String;
返回字符串AText从AStart开始的ACount个字符.
s:='abcdefg' 想取出 'cde' 这个子串:
uses StrUtils;
subs:=MidStr(s, 3, 3);
则subs为cde.



原文地址:https://www.cnblogs.com/weijie-liu/p/9645091.html