IList<T>.Sort Method

Overloads

Sort

Sorts the elements in the entire list using the comparer that was specified at construction of the list.

Sort(IComparer<T>)

Sorts the elements in the entire list using the specified comparer.

Sort(TComparison<T>)

Sorts the elements in the entire list using the specified comparison.

Sort(IComparer<T>, Integer, Integer)

Sorts the elements in a range of elements in list using the specified comparer.

Sort(TComparison<T>, Integer, Integer)

Sorts the elements in a range of elements in list using the specified comparison.

Sort

Sorts the elements in the entire list using the comparer that was specified at construction of the list.

Delphi
procedure Sort

Sort(IComparer<T>)

Sorts the elements in the entire list using the specified comparer.

Delphi
procedure Sort(const comparer: IComparer<T>)

Parameters

comparer
IComparer<T>

The comparer to use when comparing elements.

Exceptions

comparer is nil .

Sort(TComparison<T>)

Sorts the elements in the entire list using the specified comparison.

Delphi
procedure Sort(const comparer: TComparison<T>)

Parameters

comparer
TComparison<T>

The comparison to use when comparing elements.

Exceptions

comparer is nil .

Sort(IComparer<T>, Integer, Integer)

Sorts the elements in a range of elements in list using the specified comparer.

Delphi
procedure Sort(const comparer: IComparer<T>; index: Integer; count: Integer)

Parameters

comparer
IComparer<T>

The comparer to use when comparing elements.

index
Integer

The zero-based starting index of the range to sort.

count
Integer

The length of the range to sort.

Exceptions

comparer is nil .

index is less than 0.

-or-

count is less than 0.

-or-

index and count do not specify a valid range in the list.

Sort(TComparison<T>, Integer, Integer)

Sorts the elements in a range of elements in list using the specified comparison.

Delphi
procedure Sort(const comparer: TComparison<T>; index: Integer; count: Integer)

Parameters

comparer
TComparison<T>

The comparer to use when comparing elements.

index
Integer

The zero-based starting index of the range to sort.

count
Integer

The length of the range to sort.

Exceptions

comparer is nil .

index is less than 0.

-or-

count is less than 0.

-or-

index and count do not specify a valid range in the list.