HenryM2
asked on
Delphi Is there a simple way to Concat two Dynamic Arrays in to one Array?
I have two Arrays
AVar Array1, Array2 : Array Of String;
Is there a way to concatinate the contents of both into a single array?
AVar Array1, Array2 : Array Of String;
Is there a way to concatinate the contents of both into a single array?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
TStringArray = array of string;
function ConcatArrays( A1, A2: array of string): TStringArray;
var
i: Integer;
begin
SetLength( Result, High(A1) + High(A2) + 2 );
for i := 0 to High(A1) do
Result[i]:= A1[i];
for i := 0 to High(A2) do
Result[High(A1)+1+i]:= A2[i];
end;