Click or drag to resize
AlgorithmsReplaceT Method (IEnumerableT, PredicateT, T)
Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. .

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IEnumerable<T> Replace<T>(
	IEnumerable<T> collection,
	Predicate<T> predicate,
	T replaceWith
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection 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.Replace``1(System.Collections.Generic.IEnumerable{``0},System.Predicate{``0},``0)"]

Return Value

Type: IEnumerableT
An new collection with the items from collection, in the same order, with the appropriate replacements made.
See Also