---
name: "reverse"
type: command
status: ok
groups: ["Arrays"]
arma3_since: "1.24"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/reverse
revid: 377138
updated: 2026-01-01T10:29:57Z
---

# reverse

*Command · Arrays · Arma 3 v1.24*

## Description

Reverses given array by reference (modifies the original array, just like [resize](../commands/resize.md)). The alternative syntax can be used to reverse a ANSI [string](../topics/String.md). If Unicode support is desired, see [forceUnicode](../commands/forceUnicode.md).

## Syntax

### Syntax 1

```sqf
reverse array
```

**Parameters:**

- `array`: [Array](../topics/Array.md) of [Anything](../topics/Anything.md)

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

*since arma3 2.02*

```sqf
reverse string
```

**Parameters:**

- `string`: [String](../topics/String.md) - string to be reversed

**Returns:** [String](../topics/String.md) - reversed string

## Examples

### Example 1

```sqf
_arr = [1,2,3];
reverse _arr;
hint str _arr; // [3,2,1]
```

### Example 2

```sqf
_wordArr = toArray "gateman";
reverse _wordArr;
hint toString _wordArr; // nametag
```

### Example 3

```sqf
reverse "treboR"; // Returns "Robert"
```

## See also

[set](../commands/set.md) · [resize](../commands/resize.md) · [select](../commands/select.md) · [in](../commands/in.md) · [find](../commands/find.md) · [toArray](../commands/toArray.md) · [toString](../commands/toString.md) · [forEach](../commands/forEach.md) · [count](../commands/count.md) · [pushBack](../commands/pushBack.md) · [pushBackUnique](../commands/pushBackUnique.md) · [apply](../commands/apply.md) · [append](../commands/append.md) · [sort](../commands/sort.md) · [param](../commands/param.md) · [params](../commands/params.md) · [arrayIntersect](../commands/arrayIntersect.md) · [splitString](../commands/splitString.md) · [joinString](../commands/joinString.md) · [forceUnicode](../commands/forceUnicode.md)

<sub>Source: [BI Community Wiki — reverse](https://community.bistudio.com/wiki/reverse) (revision 377138).</sub>
