Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses Types;
- function SplitStr(const Str: string; const Delimiter: string): TStringDynArray;
- var
- L : Integer;
- I : Integer;
- S : Integer;
- D : Integer;
- A : Integer;
- begin
- L := Length(Str);
- S := 1;
- D := Length(Delimiter);
- I := 1;
- while I <= L do
- begin
- if Copy(Str, I, D) = delimiter then
- begin
- A := Length(Result);
- SetLength(Result, A + 1);
- Result[A] := Copy(Str, S, I - S);
- S := I + D;
- Inc(I, D);
- end
- else
- Inc(I);
- end;
- A := Length(Result);
- SetLength(Result, A + 1);
- Result[A] := Copy(Str, S, L-S);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement