StringCollection.ICollection.CopyTo(Array, Int32) メソッド
定義
StringCollection 全体を互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。Copies the entire StringCollection to a compatible one-dimensional Array, starting at the specified index of the target array.
virtual void System.Collections.ICollection.CopyTo(Array ^ array, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array array, int index);
void ICollection.CopyTo (Array? array, int index);
abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit
Sub CopyTo (array As Array, index As Integer) Implements ICollection.CopyTo
パラメーター
- array
- Array
Array から要素がコピーされる 1 次元の StringCollection。The one-dimensional Array that is the destination of the elements copied from StringCollection. Array には、0 から始まるインデックス番号が必要です。The Array must have zero-based indexing.
- index
- Int32
コピーの開始位置とする array
のインデックス (0 から始まる)。The zero-based index in array
at which copying begins.
実装
例外
array
が null
です。array
is null
.
index
が 0 未満です。index
is less than zero.
array
が多次元です。array
is multidimensional.
- または --or-
コピー元の StringCollection の要素数が、コピー先 array
の index
から最後までの使用可能領域を超えています。The number of elements in the source StringCollection is greater than the available space from index
to the end of the destination array
.
コピー元の StringCollection の型をコピー先の array
の型に自動的にキャストすることはできません。The type of the source StringCollection cannot be cast automatically to the type of the destination array
.
注釈
指定された配列は、互換性のある型である必要があります。The specified array must be of a compatible type.
このメソッドは Array.Copy 、を使用して要素をコピーします。This method uses Array.Copy to copy the elements.
このメソッドは O(n
) 操作です。n
は Count です。This method is an O(n
) operation, where n
is Count.