Strrev Function

Action

Reverses the order of characters of a string.

Include file

Kernel.bdh

Syntax

Strrev(inout sString: string): string;

Return value

The reversed string.

Parameter Description
sString String to reverse. This parameter also contains the result after the Strrev operation.

Example

dcltrans
  transaction TStrrev
  var
    sString: string;
  begin
    sString := "Hello world!";
    write("String = "); write(sString); writeln;
    // reverse characters of string
    Strrev(sString);
    write("String = "); write(sString); writeln;
  end TStrrev;

Output

String = Hello world!
String = !dlrow olleH