{"name":"parseSimpleArray","title":"parseSimpleArray","type":"command","url":"https://community.bistudio.com/wiki/parseSimpleArray","revid":363379,"updated":"2024-03-29T13:22:55Z","groups":["Strings","Arrays"],"status":"ok","games":{"arma3":"1.68"},"since":"arma3 1.68","arma3_since":"1.68","description":"Converts given, formatted as simple array, String into a valid Array. Simple array is array consisting of Numbers, Strings, Booleans and Arrays of all of the above.\nThis command is almost **4× faster** than similar uncached call compile method. And because call compile is not required, it is also **more secure** and primarily intended for use with callExtension to parse the String output into Array.\n\n> [!NOTE]\n> Since Arma 3 v1.96 the command tolerates extra spaces and supports single quotes. The only recognised keywords (case **in**sensitive) are:\n>\n> - `true` - translates into true\n> - `false` - translates into false\n> - `nil` - translates into nil\n> - `null` - translates into nil\n> - `<null>` - translates into nil (*not* objNull)\n> - `any` - translates into nil","syntaxes":[{"syntax":"parseSimpleArray stringArray","params":[{"name":"stringArray","type":"String","description":"string formatted as simple array","type_expr":"String"}],"returns":{"type":"Array","type_expr":"Array","description":"valid array"},"form":"unary","right":{"text":"stringArray"}}],"examples":[{"code":["private _arr = parseSimpleArray \"[1,2,3]\";"]},{"code":["private _array1 = [1, \"2\", true, [4, \"five\", false]];\nprivate _array2 = parseSimpleArray \"[1,\"\"2\"\",true,[4,\"\"five\"\",false]]\";\n_array1 isEqualTo _array2; // true"]},{"code":["_bool = true;\n_num = 123.45;\n_str = \"ok\";\n_arr = [1, false, \"cool\"];\n_res = parseSimpleArray format [\"[%1,%2,%3,%4]\", _bool, _num, str _str, str _arr];\n// note how _bool and _num do not need str, however if used anyway, the result in this case would be identical\nhint str _res;  // returns [true,123.45,\"ok\",[1,false,\"cool\"]]"]}],"see_also":["set","resize","pushBack","pushBackUnique","select","apply","reverse","count","find","in","forEach","deleteAt","deleteRange","append","sort","arrayIntersect","callExtension"]}