---
name: "parseSimpleArray"
type: command
status: ok
groups: ["Strings", "Arrays"]
arma3_since: "1.68"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/parseSimpleArray
revid: 363379
updated: 2024-03-29T13:22:55Z
---

# parseSimpleArray

*Command · Strings, Arrays · Arma 3 v1.68*

## Description

Converts given, formatted as simple array, [String](../topics/String.md) into a valid [Array](../topics/Array.md). Simple array is array consisting of [Number](../topics/Number.md)s, [String](../topics/String.md)s, [Boolean](../topics/Boolean.md)s and [Array](../topics/Array.md)s of all of the above.
This command is almost **4× faster** than similar uncached [call](../commands/call.md) [compile](../commands/compile.md) method. And because [call](../commands/call.md) [compile](../commands/compile.md) is not required, it is also **more secure** and primarily intended for use with [callExtension](../commands/callExtension.md) to parse the [String](../topics/String.md) output into [Array](../topics/Array.md).

> [!NOTE]
> Since Arma 3 v1.96 the command tolerates extra spaces and supports single quotes. The only recognised keywords (case **in**sensitive) are:
> - `true` - translates into [true](../commands/true.md)
> - `false` - translates into [false](../commands/false.md)
> - `nil` - translates into [nil](../commands/nil.md)
> - `null` - translates into [nil](../commands/nil.md)
> - `<null>` - translates into [nil](../commands/nil.md) (*not* [objNull](../commands/objNull.md))
> - `any` - translates into [nil](../commands/nil.md)

## Syntax

```sqf
parseSimpleArray stringArray
```

**Parameters:**

- `stringArray`: [String](../topics/String.md) - string formatted as simple array

**Returns:** [Array](../topics/Array.md) - valid array

## Examples

### Example 1

```sqf
private _arr = parseSimpleArray "[1,2,3]";
```

### Example 2

```sqf
private _array1 = [1, "2", true, [4, "five", false]];
private _array2 = parseSimpleArray "[1,""2"",true,[4,""five"",false]]";
_array1 isEqualTo _array2; // true
```

### Example 3

```sqf
_bool = true;
_num = 123.45;
_str = "ok";
_arr = [1, false, "cool"];
_res = parseSimpleArray format ["[%1,%2,%3,%4]", _bool, _num, str _str, str _arr];
// note how _bool and _num do not need str, however if used anyway, the result in this case would be identical
hint str _res;  // returns [true,123.45,"ok",[1,false,"cool"]]
```

## See also

[set](../commands/set.md) · [resize](../commands/resize.md) · [pushBack](../commands/pushBack.md) · [pushBackUnique](../commands/pushBackUnique.md) · [select](../commands/select.md) · [apply](../commands/apply.md) · [reverse](../commands/reverse.md) · [count](../commands/count.md) · [find](../commands/find.md) · [in](../commands/in.md) · [forEach](../commands/forEach.md) · [deleteAt](../commands/deleteAt.md) · [deleteRange](../commands/deleteRange.md) · [append](../commands/append.md) · [sort](../commands/sort.md) · [arrayIntersect](../commands/arrayIntersect.md) · [callExtension](../commands/callExtension.md)

<sub>Source: [BI Community Wiki — parseSimpleArray](https://community.bistudio.com/wiki/parseSimpleArray) (revision 363379).</sub>
