Table of Contents

Class ListExtensions

Namespace
LfrlAnvil.Extensions
Assembly
LfrlAnvil.Core.dll

Contains IList<T> extension methods.

public static class ListExtensions
Inheritance
ListExtensions
Inherited Members

Methods

RemoveLast<T>(IList<T>)

Removes the last item from the provided list.

public static void RemoveLast<T>(this IList<T> list)

Parameters

list IList<T>

Source list.

Type Parameters

T

List item type.

Exceptions

ArgumentOutOfRangeException

When list is empty.

SwapItems<T>(IList<T>, int, int)

Swaps two items in the provided list.

public static void SwapItems<T>(this IList<T> list, int index1, int index2)

Parameters

list IList<T>

Source list.

index1 int

Index of the first item to swap.

index2 int

Index of the second item to swap.

Type Parameters

T

List item type.