Next Method
Definition
- Namespace
- Cuemon.Extensions.Collections.Generic
- Assemblies
- Cuemon.Extensions.Collections.Generic.dll
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
listIList<T>The IList<T> to extend.
indexintThe index of which to advance to the next element from.
Returns
- T
default(TSource) if
indexis equal or greater than Count; otherwise the next element oflistrelative toindex.
Type Parameters
TThe type of elements in the IList<T>.
Exceptions
- ArgumentNullException
listis null.- ArgumentOutOfRangeException
indexis less than 0.