unit UtilFuncs;

interface

uses
  Types;

type
  TStrArr = array of AnsiString;

function StrExplode(const Str: AnsiString; const Separator: AnsiString): TStrArr;

implementation

function StrExplode(const Str: AnsiString; const Separator: AnsiString): TStrArr;
var
  i: Integer;
  j: Integer;
  CurElement: Integer;
  PrevParamIndex: Integer;
  b: Boolean;
begin
  SetLength(Result, Length(Str));
  CurElement := 0;
  PrevParamIndex := 1;
  for i := 1 to Length(Str) do
  begin
    b := True;
    for j := 0 to Length(Separator) - 1 do
    begin
      if Separator[j + 1] <> Str[i + j] then
      begin
        b := False;
        Break;
      end;
    end;
    if b then
    begin
      SetLength(Result[CurElement], i - PrevParamIndex);
      Move(Str[PrevParamIndex], Result[CurElement][1], i - PrevParamIndex);
      PrevParamIndex := i + Length(Separator);
      Inc(CurElement);
    end;
  end;
  if Length(Str) > PrevParamIndex then
  begin
    SetLength(Result[CurElement], Length(Str) - PrevParamIndex);
    Move(Str[PrevParamIndex], Result[CurElement][1], Length(Str) - PrevParamIndex);
    Inc(CurElement);
  end;
  SetLength(Result, CurElement);
end;

end.