---
name: "BIS_fnc_subSelect"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_subSelect
revid: 327163
updated: 2022-07-12T22:02:05Z
---

# BIS_fnc_subSelect

*Function · Arrays · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Returns a sub-selection of the passed array.

## Syntax

```sqf
[array, start, endOrLength] call BIS_fnc_subSelect
```

**Parameters:**

- `array`: [Array](../topics/Array.md) array to select sub array from
- `start`: [Number](../topics/Number.md) index of array to begin sub-array. **If negative**, index is counted from the end of array
- `endOrLength`: [Number](../topics/Number.md) - index of array to end the sub-array. If ommitted, remainder of the array will be selected. **If negative**, it specifies the length of the sub-array (in absolute form)

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

## Examples

### Example 1

```sqf
private _array = ["a", "b", true, 3, 8];
[_array, 2] call BIS_fnc_subSelect;            // returns [true,3,8]
```

### Example 2

```sqf
[_array, -2] call BIS_fnc_subSelect;            // returns [3,8]
```

### Example 3

```sqf
[_array, 1, 3] call BIS_fnc_subSelect;            // returns ["b",true,3]
```

### Example 4

```sqf
[_array, 1, -2] call BIS_fnc_subSelect;        // returns ["b",true]
```

## See also

[select](../commands/select.md) · [count](../commands/count.md) · [selectRandom](../commands/selectRandom.md) · [BIS_fnc_arrayShuffle](../functions/BIS_fnc_arrayShuffle.md) · [BIS_fnc_randomIndex](../functions/BIS_fnc_randomIndex.md)

<sub>Source: [BI Community Wiki — BIS fnc subSelect](https://community.bistudio.com/wiki/BIS_fnc_subSelect) (revision 327163).</sub>
