{"name":"BIS_fnc_trimString","title":"BIS fnc trimString","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_trimString","revid":340879,"updated":"2023-05-13T21:38:38Z","groups":["Strings"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Get a substring out of the string.\n\n> [!NOTE]\n> **Arma 3:** Use select instead.","syntaxes":[{"syntax":"[someText, beginning, length] call BIS_fnc_trimString","params":[{"name":"someText","type":"String","description":"source string","type_expr":"String"},{"name":"beginning","type":"Number","optional":true,"default":"0","description":"start index; indexing starts at 0","type_expr":"Number","text":"beginning: Number (Optional, default 0) - start index; indexing starts at 0"},{"name":"length","type":"Number","optional":true,"default":"end of string","description":"end index. A negative number means X chars *from the string end*","type_expr":"Number","text":"length: Number (Optional, default end of string) - end index. A negative number means X chars *from the string end*"}],"returns":{"type":"String","type_expr":"String"}}],"examples":[{"text":"```sqf\n[\"dreaded_is_the_man\", 0, 6] call BIS_fnc_trimString;    // will return \"dreaded\"\n```","code":["[\"dreaded_is_the_man\", 0, 6] call BIS_fnc_trimString;\t// will return \"dreaded\""]},{"text":"```sqf\n[\"dreaded_is_the_man\", 15] call BIS_fnc_trimString;    // will return \"man\"\n```","code":["[\"dreaded_is_the_man\", 15] call BIS_fnc_trimString;\t// will return \"man\""]},{"text":"```sqf\n[\"dreaded_is_the_man\"] call BIS_fnc_trimString;        // will return \"dreaded_is_the_man\"\n```","code":["[\"dreaded_is_the_man\"] call BIS_fnc_trimString;\t\t// will return \"dreaded_is_the_man\""]}],"see_also":["select"],"notes":[{"user":"R3vo","date":"2017-08-24T15:45:00Z","text":"```sqf\n\"test\" select [0, 4];                        // 0.0007 ms\n[\"test\", 0, 4] call BIS_fnc_trimString;    // 0.013 ms\n```\n\nThe first method is about **18 times faster**."}]}