delphi 替换指定字符串的函数


本文整理自网络,侵删。

 一个替换指定串的函数,从一个字符串中找出指定子串,并替换为另一子串。
代码如下:
function replacing(S,source,target:string):string;
var site,StrLen:integer;
begin
{source在S中出现的位置}
site:=pos(source,s);
{source的长度}
StrLen:=length(source);
{删除source字符串}
delete(s,site,StrLen);
{插入target字符串到S中}
insert(target,s,site);
{返回新串}
replacing:=s;
end;

相关阅读 >>

Delphi判断不同格式的时间是否相等

Delphi tms web core webmemo 横竖滚动条

Delphi 获取系统的硬盘分区及使用信息

Delphi 从字符串提取字符串

Delphi 递归算法遍历文件

Delphi mediaplayer循环播放mp3所有音乐文件问题?

Delphi 从 exe 或 dll 中获取图标的函数

Delphi的获取某坐标的颜色值

Delphi 获得memo、richedit的光标位置

Delphi tpath.combine(); {结合路径}

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



打赏

取消

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

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

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

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

评论

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