SortedDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) Método
Definição
Copia os elementos SortedDictionary<TKey,TValue>.KeyCollection para uma matriz unidimensional existente, começando no índice especificado da matriz.Copies the SortedDictionary<TKey,TValue>.KeyCollection elements to an existing one-dimensional array, starting at the specified array index.
public:
virtual void CopyTo(cli::array <TKey> ^ array, int index);
public void CopyTo (TKey[] array, int index);
abstract member CopyTo : 'Key[] * int -> unit
override this.CopyTo : 'Key[] * int -> unit
Public Sub CopyTo (array As TKey(), index As Integer)
Parâmetros
- array
- TKey[]
A matriz unidimensional que é o destino dos elementos copiados do SortedDictionary<TKey,TValue>.KeyCollection.The one-dimensional array that is the destination of the elements copied from the SortedDictionary<TKey,TValue>.KeyCollection. A matriz deve ter indexação com base em zero.The array must have zero-based indexing.
- index
- Int32
O índice com base em zero em array no qual a cópia começa.The zero-based index in array at which copying begins.
Implementações
Exceções
array é null.array is null.
index é menor que 0.index is less than 0.
O número de elementos na origem SortedDictionary<TKey,TValue>.KeyCollection é maior do que o espaço disponível de index até o final do array de destino.The number of elements in the source SortedDictionary<TKey,TValue>.KeyCollection is greater than the available space from index to the end of the destination array.
Comentários
Os elementos são copiados para a matriz na mesma ordem em que o enumerador itera por meio do SortedDictionary<TKey,TValue>.KeyCollection .The elements are copied to the array in the same order in which the enumerator iterates through the SortedDictionary<TKey,TValue>.KeyCollection.
Este método é uma operação O(n), em que n é Count.This method is an O(n) operation, where n is Count.