IImmutableList<T>.Replace(T, T, IEqualityComparer<T>) Método
Definição
Retorna uma nova lista com o elemento de primeira correspondência na lista substituída pelo elemento especificado.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)
Parâmetros
- oldValue
- T
O elemento a ser substituído.The element to be replaced.
- newValue
- T
O elemento pelo qual substituir a primeira ocorrência de oldValueThe element to replace the first occurrence of oldValue with
- equalityComparer
- IEqualityComparer<T>
O comparador de igualdade a ser usado para a correspondência com oldValue.The equality comparer to use for matching oldValue.
Retornos
Uma nova lista que contém newValue, mesmo que oldvalue seja o mesmo que newValue.A new list that contains newValue, even if oldvalue is the same as newValue.
Exceções
oldValue não existe na lista.oldValue does not exist in the list.