Skip to main content
HttpLanguageHeaderValueCollection.CopyTo method

Copies the elements of the collection to an array, starting at a particular array index in the destination array.


public void CopyTo(
  Language[] array, 
  int arrayIndex

Public Sub CopyTo(
  array As Language(),  
  arrayIndex As Integer 



Type: array of Language

The one-dimensional Array of Language items that is the destination of the elements copied from the collection. The Array must have zero-based indexing.


Type: System.Int32

The zero-based index in array at which copying begins.


The elements are copied to the array in the same order in which the enumerator iterates through the collection. It's typical to specify arrayIndex as 0 if all you're doing is making a simple copy of the collection items, where you've created a destination array with a length that matches the Count of the collection you're copying.

This method will throw an exception if the number of elements in the source collection is greater than the length of the destination array.

If you are programming with Visual C++ component extensions (C++/CX), GetMany has similar behavior to CopyTo, but note that the parameters are in a different order. Or you can make an IVectorView copy by calling GetView.

Requirements (Windows 10 device family)

Device family

API contract



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]



See also