{"name":"reverse","operator":null,"title":"reverse","type":"command","url":"https://community.bistudio.com/wiki/reverse","revid":377138,"updated":"2026-01-01T10:29:57Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.24"}],"since":{"game":"arma3","name":"Arma 3","version":"1.24"},"arma3_since":"1.24","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array of Anything","optional":false,"default":null,"description":null,"types":["Array","Anything"],"since":null,"text":"array: Array of Anything"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"array","types":["Array","Anything"]}},{"syntax":"reverse string","since":"arma3 2.02","effect":null,"exec":null,"params":[{"name":"string","type":"String","optional":false,"default":null,"description":"string to be reversed","types":["String"],"since":null,"text":"string: String - string to be reversed"}],"returns":{"type":"String","types":["String"],"description":"reversed string","text":"String - reversed string"},"form":"unary","operator":null,"left":null,"right":{"text":"string","types":["String"]}}],"examples":[{"text":"```sqf\n_arr = [1,2,3];\nreverse _arr;\nhint str _arr; // [3,2,1]\n```","code":["_arr = [1,2,3];\nreverse _arr;\nhint str _arr; // [3,2,1]"]},{"text":"```sqf\n_wordArr = toArray \"gateman\";\nreverse _wordArr;\nhint toString _wordArr; // nametag\n```","code":["_wordArr = toArray \"gateman\";\nreverse _wordArr;\nhint toString _wordArr; // nametag"]},{"text":"```sqf\nreverse \"treboR\"; // Returns \"Robert\"\n```","code":["reverse \"treboR\"; // Returns \"Robert\""]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["set","resize","select","in","find","toArray","toString","forEach","count","pushBack","pushBackUnique","apply","append","sort","param","params","arrayIntersect","splitString","joinString","forceUnicode"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Arrays","Introduced with Arma 3 version 1.24","Scripting Commands"]}