ImmutableList<T>.Sort 方法

定義

多載

Sort()

使用預設的比較子來排序整個不可變清單中的元素。

Sort(IComparer<T>)

使用指定的比較子來排序整個不可變清單中的元素。

Sort(Comparison<T>)

使用指定的比較子來排序整個不可變清單中的元素。

Sort(Int32, Int32, IComparer<T>)

使用指定的比較子來排序不可變清單某範圍內的元素。

Sort()

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用預設的比較子來排序整個不可變清單中的元素。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort();
public System.Collections.Immutable.ImmutableList<T> Sort ();
member this.Sort : unit -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort () As ImmutableList(Of T)

傳回

已排序的清單。

適用於

Sort(IComparer<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子來排序整個不可變清單中的元素。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableList<T> Sort (System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableList<T> Sort (System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : System.Collections.Generic.IComparer<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort (comparer As IComparer(Of T)) As ImmutableList(Of T)

參數

comparer
IComparer<T>

比較項目時所使用的實作,或 null 表示使用預設的比較子 (Default)。

傳回

已排序的清單。

適用於

Sort(Comparison<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子來排序整個不可變清單中的元素。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(Comparison<T> ^ comparison);
public System.Collections.Immutable.ImmutableList<T> Sort (Comparison<T> comparison);
member this.Sort : Comparison<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Sort (comparison As Comparison(Of T)) As ImmutableList(Of T)

參數

comparison
Comparison<T>

比較元素時所要使用的委派。

傳回

已排序的清單。

例外狀況

comparisonnull

適用於

Sort(Int32, Int32, IComparer<T>)

來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs
來源:
ImmutableList_1.cs

使用指定的比較子來排序不可變清單某範圍內的元素。

public:
 System::Collections::Immutable::ImmutableList<T> ^ Sort(int index, int count, System::Collections::Generic::IComparer<T> ^ comparer);
public System.Collections.Immutable.ImmutableList<T> Sort (int index, int count, System.Collections.Generic.IComparer<T> comparer);
public System.Collections.Immutable.ImmutableList<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.ImmutableList<'T>
Public Function Sort (index As Integer, count As Integer, comparer As IComparer(Of T)) As ImmutableList(Of T)

參數

index
Int32

要排序範圍內之以零為起始的起始索引。

count
Int32

要排序的範圍長度。

comparer
IComparer<T>

比較項目時所使用的實作,或 null 表示使用預設的比較子 (Default)。

傳回

已排序的清單。

適用於