ImmutableArray<T>.Sort 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Sort() |
使用預設比較子排序不可變數組中的專案。 |
| Sort(IComparer<T>) |
使用指定的比較子來排序不可變數組中的專案。 |
| Sort(Int32, Int32, IComparer<T>) |
使用指定的比較子,排序不可變數組中的指定專案。 |
Sort()
使用預設比較子排序不可變數組中的專案。
public:
System::Collections::Immutable::ImmutableArray<T> Sort();
public System.Collections.Immutable.ImmutableArray<T> Sort();
member this.Sort : unit -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort () As ImmutableArray(Of T)
傳回
一個新的不可變陣列,依排序順序包含該陣列中的項目。
適用於
Sort(IComparer<T>)
使用指定的比較子來排序不可變數組中的專案。
public:
System::Collections::Immutable::ImmutableArray<T> Sort(System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableArray<T> Sort(System.Collections.Generic.IComparer<T> comparer);
member this.Sort : System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort (comparer As IComparer(Of T)) As ImmutableArray(Of T)
參數
- comparer
- IComparer<T>
比較元素時使用的實作,或 null 是使用預設的比較器。
傳回
一個新的不可變陣列,依排序順序包含該陣列中的項目。
適用於
Sort(Int32, Int32, IComparer<T>)
使用指定的比較子,排序不可變數組中的指定專案。
public:
System::Collections::Immutable::ImmutableArray<T> Sort(int index, int count, System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableArray<T> Sort(int index, int count, System.Collections.Generic.IComparer<T> comparer);
member this.Sort : int * int * System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Function Sort (index As Integer, count As Integer, comparer As IComparer(Of T)) As ImmutableArray(Of T)
參數
- index
- Int32
第一個要排序的元素索引。
- count
- Int32
排序中應包含的元素數量。
- comparer
- IComparer<T>
比較元素時使用的實作,或 null 是使用預設的比較器。
傳回
一個新的不可變陣列,依排序順序包含該陣列中的項目。