---
url: >-
  /statelake/scripting-reference/functions-and-procedures/string-functions/reversestring.md
---

# ReverseString

**ReverseString** returns a mirror-image string based on the specified string **S**, with the sequence of characters reversed.

**Declaration**: function ReverseString(const S: string): string;

An example follows.

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := ReverseString('Statelake 123');    //returns '321 ekaletatS'
end;
```

This function does the same thing as **Reverse** [Reverse](/statelake/scripting-reference/functions-and-procedures/what-is-a-procedure/user-defined-procedures) .
