AlgorithmsReplaceT Method (IEnumerableT, T, T) |
Replace all items in a collection equal to a particular value with another values, yielding another collection.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IEnumerable<T> Replace<T>(
IEnumerable<T> collection,
T itemFind,
T replaceWith
)
public:
generic<typename T>
static IEnumerable<T>^ Replace(
IEnumerable<T>^ collection,
T itemFind,
T replaceWith
)
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.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Replace``1(System.Collections.Generic.IEnumerable{``0},``0,``0)"]
Return Value
Type:
IEnumerableTAn new collection with the items from
collection, in the same order,
with the appropriate replacements made.
RemarksThe default sense of equality for T is used, as defined by T's
implementation of IComparable<T>.Equals or object.Equals.
See Also