Click or drag to resize
AlgorithmsReplaceT Method (IEnumerableT, T, T, IEqualityComparerT)
Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed IEqualityComparer is used to determine equality.

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,
	T itemFind,
	T replaceWith,
	IEqualityComparer<T> equalityComparer
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to process.
itemFind
Type: T
The value to find and replace within collection.
replaceWith
Type: T
The new value to replace with.
equalityComparer
Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Replace``1(System.Collections.Generic.IEnumerable{``0},``0,``0,System.Collections.Generic.IEqualityComparer{``0})"]

Return Value

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