ImmutableArray<T>.Builder.Sort Method

Definition

Overloads

Sort()

Sorts the contents of the array.

Sort(IComparer<T>)

Sorts the contents of the array.

Sort(Comparison<T>)

Sorts the elements in the entire array using the specified Comparison<T>.

Sort(Int32, Int32, IComparer<T>)

Sorts the contents of the array.

Sort()

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Sorts the contents of the array.

C#
public void Sort();

Applies to

.NET 10 and other versions
Product Versions
.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 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Sort(IComparer<T>)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Sorts the contents of the array.

C#
public void Sort(System.Collections.Generic.IComparer<T> comparer);
C#
public void Sort(System.Collections.Generic.IComparer<T>? comparer);

Parameters

comparer
IComparer<T>

The comparer to use for sorting. If comparer is null, the default comparer for the elements type in the array is used.

Applies to

.NET 10 and other versions
Product Versions
.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 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

Sort(Comparison<T>)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Sorts the elements in the entire array using the specified Comparison<T>.

C#
public void Sort(Comparison<T> comparison);

Parameters

comparison
Comparison<T>

The Comparison<T> to use when comparing elements.

Exceptions

comparison is null.

Applies to

.NET 10 and other versions
Product Versions
.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 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

Sort(Int32, Int32, IComparer<T>)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Sorts the contents of the array.

C#
public void Sort(int index, int count, System.Collections.Generic.IComparer<T> comparer);
C#
public void Sort(int index, int count, System.Collections.Generic.IComparer<T>? comparer);

Parameters

index
Int32

The starting index for the sort.

count
Int32

The number of elements to include in the sort.

comparer
IComparer<T>

The comparer to use for sorting. If comparer is null, the default comparer for the elements type in the array is used.

Applies to

.NET 10 and other versions
Product Versions
.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 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0