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
colList<T>The collection from where item is substracted.
matchPredicate<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
colis null ormatchis 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
colList<T>The collection from where items are substracted.
matchPredicate<T>The Predicate<T> delegate that defines the conditions of the items to substract.
Returns
Type Parameters
T
Remarks
Using this methods makes sense if the col is sorted according to the specified match.
Exceptions
- ArgumentNullException
colis null ormatchis 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
colList<T>The collection from where items are substracted.
matchPredicate<T>The Predicate<T> delegate that defines the conditions of the items to substract.
Returns
Type Parameters
T
Exceptions
- ArgumentNullException
colis null ormatchis null.