Table of Contents

Class ListExtensions

Namespace
System.Collections.Generic
Assembly
Arc4u.dll

Provides a set of static methods extending the List<T> class.

public static class ListExtensions
Inheritance
ListExtensions
Inherited Members

Methods

SubstractFirstOne<T>(List<T>, Predicate<T>)

Substracts the first item from the List<T> that match the conditions defined by the specified predicate.

public static T? SubstractFirstOne<T>(this List<T> col, Predicate<T> match)

Parameters

col List<T>

The collection from where item is substracted.

match Predicate<T>

The Predicate<T> delegate that defines the conditions of the item to substract.

Returns

T

The first substracted item from the List<T>.

Type Parameters

T

Exceptions

ArgumentNullException

col is null or match is null.

SubstractFirst<T>(List<T>, Predicate<T>)

Substracts the first items from the List<T> that match the conditions defined by the specified predicate.

public static List<T> SubstractFirst<T>(this List<T> col, Predicate<T> match)

Parameters

col List<T>

The collection from where items are substracted.

match Predicate<T>

The Predicate<T> delegate that defines the conditions of the items to substract.

Returns

List<T>

The first substracted items from the List<T>.

Type Parameters

T

Remarks

Using this methods makes sense if the col is sorted according to the specified match.

Exceptions

ArgumentNullException

col is null or match is null.

Substract<T>(List<T>, Predicate<T>)

Substracts all the items from the List<T> that match the conditions defined by the specified predicate.

public static List<T> Substract<T>(this List<T> col, Predicate<T> match)

Parameters

col List<T>

The collection from where items are substracted.

match Predicate<T>

The Predicate<T> delegate that defines the conditions of the items to substract.

Returns

List<T>

The substracted items from the List<T>.

Type Parameters

T

Exceptions

ArgumentNullException

col is null or match is null.