The reverse method reverses the order of the characters in the string:

<result> = <text>.reverse()  

<text>

A value of type string or an expression evaluating to a value of that type.

<result>

string: a copy of the text in which the characters are in reverse order.


mystring = "Hello world!";
output mystring.reverse();      // result: !dlrow olleH



Related articles