{"name":"BIS_fnc_splitString","title":"BIS fnc splitString","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_splitString","revid":323143,"updated":"2022-06-30T17:01:12Z","groups":["Strings"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Splits given string according to given separator(s).\n\n> [!NOTE]\n> **Arma 3:** See splitString.","syntaxes":[{"syntax":"[stringToSplit, separators, byWord] call BIS_fnc_splitString","params":[{"name":"stringToSplit","type":"String","type_expr":"String"},{"name":"separators","type":"String","optional":true,"default":"\"\"","description":"by default each letter is a separator. If *byWord* is set to true, the separator will be treated as whole word","type_expr":"String","text":"separators: String - (Optional, default \"\") by default each letter is a separator. If *byWord* is set to true, the separator will be treated as whole word"},{"name":"byWord","type":"Boolean","optional":true,"default":"false","description":"by default uses splitString behaviour e.g. each letter is a separator. If set to true, the separator will be treated as whole word","type_expr":"Boolean","text":"byWord: Boolean - (Optional, default false) by default uses splitString behaviour e.g. each letter is a separator. If set to true, the separator will be treated as whole word"}],"returns":{"type":"Array of Strings","type_expr":"Array<String>"}}],"examples":[{"code":["[\"this is a test\", \" \"] call BIS_fnc_splitString; // returns [\"this\", \"is\", \"a\", \"test\"]"]},{"code":["[\"this is a test\", \"st\"] call BIS_fnc_splitString; // returns [\"hi\",\" i\",\" a \",\"e\"]"]},{"code":["[\"this is a test\", \"is\"] call BIS_fnc_splitString; // returns [\"th\",\" \",\" a te\",\"t\"]"]},{"code":["[\"this is a test\", \"is\", true] call BIS_fnc_splitString; // returns [\"th\",\" \",\" a test\"]"]}],"see_also":["splitString","toArray","toString"]}