Перевернуть строку 2
Автор: Profit Manson
function ReverseString(s: string): string;
var
i: integer;
c: char;
begin
if s <> '' then
for i := 1 to Length(s) div 2 do
begin
c := s[i];
s[i] := s[Length(s) + 1 - i];
s[Length(s) + 1 - i] := c;
end;
Result := s;
end;
|