type
TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);
function StringReplace(const S, OldPattern, NewPattern: string;
Flags: TReplaceFlags): string;
自已写吧 其实很简单
function replace(str,substr:string):string;
var
len_sub, len:integer;
pos1:integer;
begin
len_sub:=length(substr);
pos1:=pos(substr,str)
if pos1<>0 then
result:=copy(str,1,pos1)+copy(str,pos1+len_sub+1,length(str)-pos1-len_sub-1)
else
result:=str;
end
end;
好像没有吧,你试试自己写一个呀
下面吧字符串s中的source替换成target
function replacing(S,source,target:string):string;
var position,StrLen:integer;
begin
{source在S中出现的位置}
replacing:=s;
position:=pos(source,s);
if position<>0 then
begin
{source的长度}
StrLen:=length(source);
{删除source字符串}
delete(s,position,StrLen);
{插入target字符串到S中}
insert (target,s,position);
{返回新串}
replacing:=s;
end;
end;