{"name":"reverse","title":"reverse","type":"command","url":"https://community.bistudio.com/wiki/reverse","revid":377138,"updated":"2026-01-01T10:29:57Z","groups":["Arrays"],"status":"ok","games":{"arma3":"1.24"},"since":"arma3 1.24","arma3_since":"1.24","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.","syntaxes":[{"syntax":"reverse array","params":[{"name":"array","type":"Array of Anything","type_expr":"Array<Anything>"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"array"}},{"syntax":"reverse string","since":"arma3 2.02","params":[{"name":"string","type":"String","description":"string to be reversed","type_expr":"String"}],"returns":{"type":"String","type_expr":"String","description":"reversed string"},"form":"unary","right":{"text":"string"}}],"examples":[{"code":["_arr = [1,2,3];\nreverse _arr;\nhint str _arr; // [3,2,1]"]},{"code":["_wordArr = toArray \"gateman\";\nreverse _wordArr;\nhint toString _wordArr; // nametag"]},{"code":["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"]}