Description
Returns a sub-selection of the passed array.
Syntax
[array, start, endOrLength] call BIS_fnc_subSelect
Parameters:
array: Array array to select sub array fromstart: Number index of array to begin sub-array. If negative, index is counted from the end of arrayendOrLength: Number - 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
Examples
Example 1
private _array = ["a", "b", true, 3, 8];
[_array, 2] call BIS_fnc_subSelect; // returns [true,3,8]
Example 2
[_array, -2] call BIS_fnc_subSelect; // returns [3,8]
Example 3
[_array, 1, 3] call BIS_fnc_subSelect; // returns ["b",true,3]
Example 4
[_array, 1, -2] call BIS_fnc_subSelect; // returns ["b",true]
See also
select · count · selectRandom · BIS_fnc_arrayShuffle · BIS_fnc_randomIndex