不知道有没有这样的函数。
procedure TForm1.Button1Click(Sender: TObject);
var
str,new:string;
i:word;
begin
str:='AbcdAbcd';
new:='';
for i:=1 to length(str) do
begin
if str='A' then
str:='Q';
new:=new+str;
end;
showmessage(new);
end;
StringReplace函数应该可以
type
TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);
function
StringReplace(const S, OldPattern, NewPattern: string;
Flags: TReplaceFlags): string;
type
TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);
function StringReplace(const S, OldPattern, NewPattern: string;
Flags: TReplaceFlags): string;
全部替换 stringReplace(s,s1,[rfReplaceAll]);