IImmutableList<T>.Replace(T, T, IEqualityComparer<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a new list with the first matching element in the list replaced with the specified element.
public:
System::Collections::Immutable::IImmutableList<T> ^ Replace(T oldValue, T newValue, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public System.Collections.Immutable.IImmutableList<T> Replace (T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
public System.Collections.Immutable.IImmutableList<T> Replace (T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T>? equalityComparer);
abstract member Replace : 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.IImmutableList<'T>
Public Function Replace (oldValue As T, newValue As T, equalityComparer As IEqualityComparer(Of T)) As IImmutableList(Of T)
Parameters
- oldValue
- T
The element to be replaced.
- newValue
- T
The element to replace the first occurrence of oldValue
with.
- equalityComparer
- IEqualityComparer<T>
The equality comparer to use for matching oldValue
.
Returns
A new list that contains newValue
, even if oldvalue
is the same as newValue
.
Exceptions
oldValue
does not exist in the list.
Applies to
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.