+ 2
array operation in c#
how to copy the value of an array to another array in c#. please help
1 Answer
+ 8
// Use Array.copy() For Example:
int[] a = {1, 2, 3, 4, 5};
int[] b = new int[4];
Array.Copy(a, 0, b, 1, 4);
⢠a = source array
⢠0 = start index in source array
⢠b = destination array
⢠1 = start index in destination array
⢠4 = elements to copy