Tag Archives: Array.Copy

Use Array.Copy to copy values in two-dimensional arrays in C#

The Array.Copy method can copy values from one array to another. For one-dimensional arrays, this is reasonably straightforward. You specify the source and destination arrays, the indices where copying should start in the two arrays, and the number of items … Continue reading

Posted in arrays | Tagged , , , , , , , , | Leave a comment

Copy arrays quickly in C#

It’s easy enough to use a for loop to copy an array, but for most arrays you can get even better performance by using the Array class’s Copy method. This takes as parameters the source and destination arrays. A third … Continue reading

Posted in arrays, performance | Tagged , , , , , , , , , , | Leave a comment