Array.CopyTo : Array « System « C# / C Sharp by API






Array.CopyTo

 

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;


public class MainClass
{

    public static void Main()
    {
        int[] srcArray = new int[] { 1, 2, 3 };
        int[] destArray = new int[] { 4, 5, 6, 7, 8, 9 };

        Array.Copy(srcArray, destArray, srcArray.Length);
        srcArray.CopyTo(destArray, 0);
        srcArray.CopyTo(destArray, 3);
        Array.Copy(srcArray, 0, destArray, 2, srcArray.Length);

    }
}

   
  








Related examples in the same category

1.Array.AsReadOnly
2.Array.BinarySearch
3.Array.Clone
4.Array.ConvertAll
5.Array.Copy
6.Array.Count
7.Array.CreateInstance
8.Array.Exists
9.Array.Find
10.Array.FindAll
11.Array.ForEach
12.Array.GetEnumerator()
13.Array.GetLength()
14.Array.GetLowerbound
15.Array.GetUpperBound
16.Array.IndexOf
17.Array.LastIndexOf
18.Array.Length
19.Array.Rank
20.Array.Resize
21.Array.Reverse
22.Array.Reverse(nums, 1, 3)
23.Array.Sort
24.Array.Sort(names, Comparer.DefaultInvariant)
25.Array.SyncRoot