{"name":"parseSimpleArray","operator":null,"title":"parseSimpleArray","type":"command","url":"https://community.bistudio.com/wiki/parseSimpleArray","revid":363379,"updated":"2024-03-29T13:22:55Z","groups":["Strings","Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.68"}],"since":{"game":"arma3","name":"Arma 3","version":"1.68"},"arma3_since":"1.68","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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> - `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","since":null,"effect":null,"exec":null,"params":[{"name":"stringArray","type":"String","optional":false,"default":null,"description":"string formatted as simple array","types":["String"],"since":null,"text":"stringArray: String - string formatted as simple array"}],"returns":{"type":"Array","types":["Array"],"description":"valid array","text":"Array - valid array"},"form":"unary","operator":null,"left":null,"right":{"text":"stringArray","types":["String"]}}],"examples":[{"text":"```sqf\nprivate _arr = parseSimpleArray \"[1,2,3]\";\n```","code":["private _arr = parseSimpleArray \"[1,2,3]\";"]},{"text":"```sqf\nprivate _array1 = [1, \"2\", true, [4, \"five\", false]];\nprivate _array2 = parseSimpleArray \"[1,\"\"2\"\",true,[4,\"\"five\"\",false]]\";\n_array1 isEqualTo _array2; // true\n```","code":["private _array1 = [1, \"2\", true, [4, \"five\", false]];\nprivate _array2 = parseSimpleArray \"[1,\"\"2\"\",true,[4,\"\"five\"\",false]]\";\n_array1 isEqualTo _array2; // true"]},{"text":"```sqf\n_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\"]]\n```","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\"]]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["set","resize","pushBack","pushBackUnique","select","apply","reverse","count","find","in","forEach","deleteAt","deleteRange","append","sort","arrayIntersect","callExtension"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Arrays","Command Group: Strings","Introduced with Arma 3 version 1.68","Scripting Commands"]}