Vlastimil Burian
unread,Feb 19, 2015, 7:34:53 AM2/19/15You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
type
TDynamicStringArray = array of string;
function Explode(const Separator: string; S: string): TDynamicStringArray;
var
I, SepPos, SepLen: Integer;
begin
if not (Separator <> '')
then raise EInvalidInputStringFunctions.Create('Explode');
I := 0;
SetLength(Result, 1);
SepLen := Length(Separator);
SepPos := Pos(Separator, S);
while SepPos > 0 do begin
Result[I] := Copy(S, 1, SepPos - 1);
Delete(S, 1, SepPos + SepLen - 1);
SepPos := Pos(Separator, S);
Inc(I);
SetLength(Result, I + 1);
end;
Result[I] := S;
end;
What is wrong? Please help.