21-08-2011, 10:52 PM
الحل
![[صورة: picture0001n.png]](http://img691.imageshack.us/img691/3928/picture0001n.png)
![[صورة: picture0001n.png]](http://img691.imageshack.us/img691/3928/picture0001n.png)
كود :
function GetSwapText(InTex: string): string;
Var
i, j, c: integer;
s: String;
t, m, R: TStringList;
begin
c := 1;
t := TStringList.Create();
m := TStringList.Create();
R := TStringList.Create();
try
t.Text := InTex;
for i := 0 to (t.Count - 1) div 2 do
begin
t.Exchange(i, t.Count - c);
inc(c);
end;
for i := 0 to (t.Count - 1) Do
begin
s := t.Strings[i];
s := copy(s, 1, length(s) - 1);
m.CommaText := s;
s := m.Strings[0];
for j := m.Count - 1 Downto 1 Do
s := s + ' ' + m.Strings[j];
R.Add(s + '.');
end;
result := R.Text;
finally
t.Free;
m.Free;
R.Free;
end;
end;
