Table of Contents

Next Method

Definition

Namespace
Cuemon.Extensions.Collections.Generic
Assemblies
Cuemon.Extensions.Collections.Generic.dll
Source
src/Cuemon.Extensions.Collections.Generic/ListExtensions.cs

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

Returns the next element of list relative to index, or the last element of list if index is equal or greater than Count.

public static T Next<T>(this IList<T> list, int index)

Parameters

list IList<T>

The IList<T> to extend.

index int

The index of which to advance to the next element from.

Returns

T

default(TSource) if index is equal or greater than Count; otherwise the next element of list relative to index.

Type Parameters

T

The type of elements in the IList<T>.

Exceptions

ArgumentNullException

list is null.

ArgumentOutOfRangeException

index is less than 0.