{"name":"BIS_fnc_subSelect","title":"BIS fnc subSelect","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_subSelect","revid":327163,"updated":"2022-07-12T22:02:05Z","groups":["Arrays"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Returns a sub-selection of the passed array.","syntaxes":[{"syntax":"[array, start, endOrLength] call BIS_fnc_subSelect","params":[{"name":"array","type":"Array array to select sub array from","type_expr":"Array"},{"name":"start","description":"Number index of array to begin sub-array. **If negative**, index is counted from the end of array","type_expr":"Number","text":"start: Number index of array to begin sub-array. **If negative**, index is counted from the end of array"},{"name":"endOrLength","type":"Number","description":"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)","type_expr":"Number"}],"returns":{"type":"Array","type_expr":"Array"}}],"examples":[{"text":"```sqf\nprivate _array = [\"a\", \"b\", true, 3, 8];\n[_array, 2] call BIS_fnc_subSelect;            // returns [true,3,8]\n```","code":["private _array = [\"a\", \"b\", true, 3, 8];\n[_array, 2] call BIS_fnc_subSelect;\t\t\t// returns [true,3,8]"]},{"text":"```sqf\n[_array, -2] call BIS_fnc_subSelect;            // returns [3,8]\n```","code":["[_array, -2] call BIS_fnc_subSelect;\t\t\t// returns [3,8]"]},{"text":"```sqf\n[_array, 1, 3] call BIS_fnc_subSelect;            // returns [\"b\",true,3]\n```","code":["[_array, 1, 3] call BIS_fnc_subSelect;\t\t\t// returns [\"b\",true,3]"]},{"text":"```sqf\n[_array, 1, -2] call BIS_fnc_subSelect;        // returns [\"b\",true]\n```","code":["[_array, 1, -2] call BIS_fnc_subSelect;\t\t// returns [\"b\",true]"]}],"see_also":["select","count","selectRandom","BIS_fnc_arrayShuffle","BIS_fnc_randomIndex"]}