DelphiBasics
AnsiReverseString
Function
Reverses the sequence of letters in a string StrUtils unit
 function AnsiReverseString(const Source AnsiString):AnsiString;
Description
The AnsiReverseString function returns the Source string with its characters reversed.
Related commands
AnsiLeftStrExtracts characters from the left of a string
AnsiMidStrReturns a substring from the middle characters of a string
AnsiRightStrExtracts characters from the right of a string
 Download this web site as a Windows program.




 
Example code : A simple example
var
  source, target : AnsiString;
begin
  source := '123456789';
  target := AnsiReverseString(source);

  ShowMessage('Source = '+source);
  ShowMessage('Target = '+target);
end;
Show full unit code
  Source = 123456789
  Target = 987654321
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page