Copies a range of elements from the List
using System; using System.Collections.Generic; public class Example { public static void Main() { List<string> myList = new List<string>(); myList.Add("A"); myList.Add("B"); myList.Add("C"); myList.Add("D"); myList.Add("E"); Console.WriteLine(); foreach (string d in myList) { Console.WriteLine(d); } // Declare an array with 15 elements. string[] array = new string[15]; myList.CopyTo(array); myList.CopyTo(array, 6); myList.CopyTo(2, array, 12, 3); Console.WriteLine("\nContents of the array:"); foreach (string d in array) { Console.WriteLine(d); } } }