Gemstone Common Library
Show/Hide TOC

# ListCollection T CopyTo Method

Copies the elements of the ICollectionT to an Array, starting at a particular Array index.

## Definition

Namespace: Gemstone.Collections
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.159 -- Release Build+a612c25bc0e1c87e5766544ec4650d2ebcfddcf4
C#
View Source Request Example

    public void CopyTo(
    	T[] array,
    	int index
    )

VB
View Source Request Example

    Public Sub CopyTo (
    	array As T(),
    	index As Integer
    )

C++
View Source Request Example

    public:
    virtual void CopyTo(
    	array<T>^ array,
    	int index
    ) sealed

JavaScript
View Source Request Example

    function CopyTo(array, index);

#### Parameters

array T
  The one-dimensional Array that is the destination of the elements copied from ICollectionT. The Array must have zero-based indexing.
index Int32
  The zero-based index in array at which copying begins.

#### Implements

ICollectionT CopyTo(T, Int32)

## Exceptions

ArgumentNullException | array is null.
ArgumentOutOfRangeException | index is less than 0.
ArgumentException | The number of elements in the source ICollectionT is greater than the available space from index to the end of the destination array.

## See Also

#### Reference

ListCollectionT Class
Gemstone.Collections Namespace