Copy of two dimension array

retkehing

Well-known member
Joined
Feb 5, 2006
Messages
153
Programming Experience
Beginner
Apart from for...loop, is there any other way for copying two dimension array to another new created two dimension array?
 
Try using either Array.Copy or Array.Clone

Array copy allows you to copy part of 1st array to the 2nd.

VB.NET:
Array.Copy(Array1,Array2)
'Copies the entire contents of array1 to 2
Array.Copy(Array1,Array2,2)
'Copies the first 2 elements
Array2 = Array1.Clone
'Clones the array


This should work with multi dimensional arrays as well
 
Back
Top