SortedSet<T>.CopyTo 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從目的陣列的開頭或指定的索引處開始,將 SortedSet<T> 的部分或全部項目複製到相容的一維陣列。
CopyTo(T[], Int32, Int32) |
從指定的陣列索引處開始,將指定的項目數目從 SortedSet<T> 複製到相容的一維陣列。 |
CopyTo(T[], Int32) |
從指定的陣列索引處開始,將完整的 SortedSet<T> 複製到相容的一維陣列中。 |
CopyTo(T[]) |
從目標陣列的開頭開始,將完整的 SortedSet<T> 複製到相容的一維陣列。 |
這個方法是作業 O(n)
,其中 n
是 Count。
- 來源:
- 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
。
備註
這個方法是作業 O(n)
,其中 n
是 count
。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 來源:
- 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。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 來源:
- 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
索引必須是以零起始的。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |