Kod: Tümünü seç
function charconvert(gelentext,s1,s2:string) : string;
var i:integer;
var hehe : boolean;
begin
hehe := false;
i:=0;
repeat
if gelentext[i] = s1 then begin
gelentext[i]:= s2;
i:=i+1;
hehe := true;
end else hehe := false;
if gelentext[i] = s2 then begin
gelentext[i]:= s1;
i:=i+1;
hehe := true;
end else hehe := false;
if hehe = false then i:=i+1;
until i=length(gelentext);
result := gelentext;
end else result := gelentext;
end;
kullanımı
procedure karaktercevir;
var s:string;
begin
s:='1,000,000.00';
s:=charconvert(s,',','.');
end;
olacaktır.
windowsun seperator ayarlarını değiştirmeden istediğimin ayıracı kullanmak için yazmıştım.