Table of Contents

Class ArraySorting

Namespace
Garyon.Extensions.ArrayExtensions
Assembly
Garyon.dll

Contains functions about sorting arrays.

[ExcludeFromCodeCoverage]
public static class ArraySorting
Inheritance
ArraySorting
Inherited Members

Methods

SortBy<T>(T[], IComparer<T>)

Sorts the array by a custom IComparer<T>. The original instance is affected.

public static T[] SortBy<T>(this T[] array, IComparer<T> comparer)

Parameters

array T[]

The array that will be sorted.

comparer IComparer<T>

The comparer that will be used when comparing the values during sorting.

Returns

T[]

The original array instance.

Type Parameters

T

The type of the values stored in the array.

SortBy<T>(T[], Comparison<T>)

Sorts the array by a custom Comparison<T>. The original instance is affected.

public static T[] SortBy<T>(this T[] array, Comparison<T> comparison)

Parameters

array T[]

The array that will be sorted.

comparison Comparison<T>

The comparison function that will be used when comparing the values during sorting.

Returns

T[]

The original array instance.

Type Parameters

T

The type of the values stored in the array.

Sort<T>(T[])

Sorts the array, affecting the original array. Returns the instance of the original array.

public static T[] Sort<T>(this T[] array)

Parameters

array T[]

The original array to sort.

Returns

T[]

Type Parameters

T

The type of the array elements.