Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Replace Method (T, T, IEqualityComparer(T))
Collapse the table of content
Expand the table of content

ImmutableList<T>.Replace Method (T, T, IEqualityComparer<T>)

Replaces the specified element in the immutable list with a new element.

Namespace:  System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public ImmutableList<T> Replace(
	T oldValue,
	T newValue,
	IEqualityComparer<T> equalityComparer


Type: T

The element to replace in the list.

Type: T

The element to replace oldValue with.

Type: System.Collections.Generic.IEqualityComparer<T>

The comparer to use to check for equality.

Return Value

Type: System.Collections.Immutable.ImmutableList<T>
A new list with the object replaced, or this list if the specified object is not in this list.
© 2015 Microsoft