Arma 3 Scripting

Command in Arrays

reverse

Also available as Markdown and JSON, or read the original wiki page.

Description

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

Syntax

Syntax 1

reverse array

Parameters:

Returns: Nothing

Syntax 2

since arma3 2.02

reverse string

Parameters:

Returns: String - reversed string

Examples

Example 1

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

Example 2

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

Example 3

reverse "treboR"; // Returns "Robert"

See also

set · resize · select · in · find · toArray · toString · forEach · count · pushBack · pushBackUnique · apply · append · sort · param · params · arrayIntersect · splitString · joinString · forceUnicode