AlgorithmsReplaceInPlaceT Method (IListT, PredicateT, T) |
Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing
the list.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static void ReplaceInPlace<T>(
IList<T> list,
Predicate<T> predicate,
T replaceWith
)
public:
generic<typename T>
static void ReplaceInPlace(
IList<T>^ list,
Predicate<T>^ predicate,
T replaceWith
)
Parameters
- list
- Type: System.Collections.GenericIListT
The list or array to process. - predicate
- Type: SystemPredicateT
The predicate used to evaluate items with the collection. If the predicate returns true for a particular
item, the item is replaces with replaceWith. - replaceWith
- Type: T
The new value to replace with.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.ReplaceInPlace``1(System.Collections.Generic.IList{``0},System.Predicate{``0},``0)"]
RemarksAlthough arrays cast to IList<T> are normally read-only, this method
will work correctly and modify an array passed as list.
See Also