Assembly: System (in system.dll)
The zero-based index in array at which copying begins.
array is a null reference (Nothing in Visual Basic).
index is less than zero.
index is equal to or greater than the length of array.
The number of elements in the source LinkedList is greater than the available space from index to the end of the destination array.
The following code example and output demonstrate the CopyTo method. The code example creates an array the same size as the linked list, and uses the CopyTo method to copy the values of all the nodes to the string array, beginning at element 0 of the array. The code example then clears the array.
This code and output are part of a larger example provided for the LinkedList class.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.