IImmutableList<T>.Replace(T, T, IEqualityComparer<T>) Metoda

Definicja

Zwraca nową listę z pierwszym pasującym elementem na liście zastąpionym określonym elementem.

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)

Parametry

oldValue
T

Element, który ma zostać zastąpiony.

newValue
T

Element, który zastąpi pierwsze wystąpienie elementu oldValue .

equalityComparer
IEqualityComparer<T>

Porównanie równości do użycia do dopasowywania oldValue.

Zwraca

Nowa lista zawierająca newValuewartość , nawet jeśli oldvalue jest taka sama jak newValue.

Wyjątki

oldValue nie istnieje na liście.

Dotyczy