This post will discuss how to a copy 2-dimensional array in C#.

A simple and straightforward solution to create a shallow copy of an array is using the Array.Clone() method. Consider the following example, which clones a 2D array of integer type. Note that the clone is of the same type as the source array.

Download  Run Code

Output:

1  2  3
4  5  6
7  8  9

That’s all about copying a 2-dimensional array in C#.