0 Members and 2 Guests are viewing this topic.
function IntSplit(const SOURCE: string; Delimiter: string): array of integer;var i, x, d: integer; s, b: string;begin d:= length(Delimiter); i:= 1; SetArrayLength(Result, 1); while (i <= length(SOURCE)) do begin s:= Copy(SOURCE, i, d); if (s = Delimiter) then begin Inc(i, d) SetArrayLength(Result, x + 1); if (RegExpMatch('^-?\d+$', b)) then begin Result[x]:= StrToInt(b); end; b:= ''; Inc(x, 1); end else begin b:= b + Copy(s, 1, 1); Inc(i, 1); end; end;end;
Look at his script name IXSplit. i.e Integer-XSplit, which is what it does, splits a string into an array of integer...
how would i use this? could someone give an example plz?