Mega Code Archive

 
Categories / Delphi / Strings
 

Reverse a string in one line of code

{=== Reverse a string ===} function ReverseStr(const sRev : string):string; var i : Integer; begin Result := ''; for i:=Length(sRev) downto 1 do Result := Result + sRev[i]; end;