Epoch/Sources/epoch_code/compile/functions/EPOCH_fnc_stringLeft.sqf
2016-06-13 11:54:19 -05:00

36 lines
939 B
Plaintext

/*
Author: Andrew Gregory - EpochMod.com
Contributors:
Description:
Picks a random spot relative to the target with some randomness. (Unused)
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_fnc_stringLeft.sqf
Example:
_trimmedStr = ["String In",3] call EPOCH_fnc_stringLeft;
Parameter(s):
_this select 0: STRING or anything - String to be trimmed
_this select 1: SCALAR - number of chars to remove
Returns:
STRING
*/
private["_arrFull","_arrOut"];
params ["_strIn",["_count",0,[0]]];
_arrOut = [];
if !(_strIn isEqualType "STRING") then {_strIn = str(_strIn)};
_arrFull = toArray _strIn;
{
if (_forEachIndex < _count) then {
_arrOut pushBack _x;
};
}forEach _arrFull;
(toString _arrOut)