語言

SortedSet<T>.CopyTo 方法

定義

將 的一部分 SortedSet<T> 或全部複製到相容的一維陣列,從目標陣列的起始或指定的索引開始。

多載

名稱 Description
CopyTo(T[], Int32, Int32)

從指定的陣列索引開始,將指定數量的元素 SortedSet<T> 從中複製到相容的一維陣列。

CopyTo(T[], Int32)

將完整 SortedSet<T> 資料複製到相容的一維陣列,從指定的陣列索引開始。

CopyTo(T[])

將完整 SortedSet<T> 資料複製到相容的一維陣列,從目標陣列的起始點開始。

備註

此方法是一個 O(n) 運算,其中 n 為 Count。

CopyTo(T[], Int32, Int32)

來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs

從指定的陣列索引開始,將指定數量的元素 SortedSet<T> 從中複製到相容的一維陣列。

public:
 void CopyTo(cli::array <T> ^ array, int index, int count);
public void CopyTo(T[] array, int index, int count);
member this.CopyTo : 'T[] * int * int -> unit
Public Sub CopyTo (array As T(), index As Integer, count As Integer)

參數

array
T[]

一個一維陣列,是從 中複製 SortedSet<T>元素的目的地。 陣列必須具有零基索引。

index
Int32

複製開始的零基索引 array 。

count
Int32

要複製的項目數目。

例外狀況

來源陣列中的元素數量多於從 index 目標陣列到末端的可用空間。

array 是 null。

index 小於零。

-或-

count 小於零。

備註

此方法是一個 O(n) 運算,其中 n 為 count。

適用於

CopyTo(T[], Int32)

來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs

將完整 SortedSet<T> 資料複製到相容的一維陣列,從指定的陣列索引開始。

public:
 virtual void CopyTo(cli::array <T> ^ array, int index);
public void CopyTo(T[] array, int index);
abstract member CopyTo : 'T[] * int -> unit
override this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), index As Integer)

參數

array
T[]

一個一維陣列,是從 中複製 SortedSet<T>元素的目的地。 陣列必須具有零基索引。

index
Int32

複製開始的零基索引 array 。

實作

例外狀況

來源陣列中的元素數量多於從 index 目標陣列到末端的可用空間。

array 是 null。

index 小於零。

備註

此方法是一個 O(n) 運算,其中 n 為 Count。

適用於

CopyTo(T[])

來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs
來源:
SortedSet.cs

將完整 SortedSet<T> 資料複製到相容的一維陣列,從目標陣列的起始點開始。

public:
 void CopyTo(cli::array <T> ^ array);
public void CopyTo(T[] array);
member this.CopyTo : 'T[] -> unit
Public Sub CopyTo (array As T())

參數

array
T[]

一個一維陣列,是從 中複製 SortedSet<T>元素的目的地。

例外狀況

來源 SortedSet<T> 中的元素數超過目的陣列能包含的元素數。

array 是 null。

備註

的 array 索引必須是零基。

適用於