Janilabo Posted August 28, 2012 Share Posted August 28, 2012 [scar]function Invert(str: string): string; var i, l: Integer; begin l := Length(str); SetLength(Result, l); for i := l downto 1 do Result := str[((l - i) + 1)]; end; begin ClearDebug; WriteLn(Invert('!boj eht od ot smees ,noitcnuf )(trevnI rof gnirts TSET a si sihT')); end.[/scar] Quote Link to comment Share on other sites More sharing options...