function InvertStr(s:string):string; var i:integer; begin SetLength(Result,Length(s)); for i:=Length(s) downto 1 do Result[Length(s)-i+1]:=s[i]; end;