Click or drag to resize
AlgorithmsReplaceInPlaceT Method (IListT, T, T)
Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing the list.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static void ReplaceInPlace<T>(
	IList<T> list,
	T itemFind,
	T replaceWith
)

Parameters

list
Type: System.Collections.GenericIListT
The list or array to process.
itemFind
Type: T
The value to find and replace within .
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},``0,``0)"]

Remarks

The default sense of equality for T is used, as defined by T's implementation of IComparable<T>.Equals or object.Equals.

Although arrays cast to IList<T> are normally read-only, this method will work correctly and modify an array passed as list.

See Also