سلام به دوستان
من قبلاً این مشکل رو اشتم و با این تابع مشکلم رو حل کردم. امیدوارم شما هم بتونید
Function TextConvert(var Sourec_str:string):string;
var
str , s , t : String;
i : byte;
ch1 , ch2 :string[1];
begin
ch1 := 'ک';
ch2 := 'ي';
if ( Length ( trim ( Sourec_str ) ) > 0 )
and ( ( POS ( ch1 , trim ( Sourec_str ) ) > 0 ) ) or
( ( POS ( ch2 , trim ( Sourec_str ) ) > 0 ) )then
begin
str := '';
s := Sourec_str;
repeat
i := POS ( ch1 , s );
if i > 0 then
begin
t := copy ( s , 1 , i - 1 );
t := t + 'ك';
str := str + t;
s := copy ( s , i + 1 , length ( s ) - length ( t ) );
end;
until i = 0;
if trim ( s ) <> '' then
str := str + s ;
Sourec_str := str;
str := '';
s := Sourec_str;
repeat
i := POS ( ch2 , s );
if i > 0 then
begin
t := copy ( s , 1 , i - 1 );
t := t + 'ي';
str := str + t;
s := copy ( s , i + 1 , length ( s ) - length ( t ) );
end;
until i = 0;
if trim ( s ) <> '' then
str := str + s;
end
else
str := Sourec_str;
result := str;
end;