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

Definicja

Zastępuje pierwszy element równości na liście określonym elementem.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::IImmutableList<T> ^ Replace(System::Collections::Immutable::IImmutableList<T> ^ list, T oldValue, T newValue);
public static System.Collections.Immutable.IImmutableList<T> Replace<T> (this System.Collections.Immutable.IImmutableList<T> list, T oldValue, T newValue);
static member Replace : System.Collections.Immutable.IImmutableList<'T> * 'T * 'T -> System.Collections.Immutable.IImmutableList<'T>
<Extension()>
Public Function Replace(Of T) (list As IImmutableList(Of T), oldValue As T, newValue As T) As IImmutableList(Of T)

Parametry typu

T

Typ elementów na liście.

Parametry

list
IImmutableList<T>

Lista do wyszukania.

oldValue
T

Element do zastąpienia.

newValue
T

Element, który zastąpi stary element.

Zwraca

Nowa lista — nawet jeśli zamieniona wartość jest równa nowej wartości dla tej pozycji.

Wyjątki

oldValue nie istnieje na liście.

Dotyczy