Ja, stimmt schon
Is was dran
Da ich vor dem Wink mit dem Zaunspfahl schon angefangen hatte, hier mal meine (trotzdem viel zu lange) Lösung des ganzen:
C Alles anzeigen/* File: fn_cutString.sqf Author: blackfisch for Native-Network.net Description: cuts a string from desired starting index and returns given number of characters */ params [ ["_string","",[""]], //string to be split - _this select 0 ["_start",0,[0]], //index of first extracted element - _this select 1 ["_length",0,[0]] //number of elements to be extracted - _this select 2 ]; private _count = count _string; if (_count isEqualTo 0) exitWith {}; //no input string if (_start > _count) exitWith {}; //starting point out of range _string = toArray _string; //convert to array if (_start < 0) then {_start = 0}; //never start at negative index _length = _start + _length; //make length an index if (_length > _count) then { _length = _count }; //end point out of range > adjust for "_i" from _count to _length step -1 do { //delete all chars after length index _string deleteAt _i; }; for "_i" from (_start - 1) to 0 step -1 do { //delete all chars before start index _string deleteAt _i; }; toString _string; //output
Mhhh,
wenn du es so scheiße machen willst, mach es zumindest so schnell wie möglich. select [] funktioniert auch mit Arrays....