ImmutableArray<T>.IImmutableList<T>.Replace 方法

定義

尋找陣列中等於指定值的第一個專案,並以指定的新值取代值。

 virtual System::Collections::Immutable::IImmutableList<T> ^ System.Collections.Immutable.IImmutableList<T>.Replace(T oldValue, T newValue, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer) = System::Collections::Immutable::IImmutableList<T>::Replace;
System.Collections.Immutable.IImmutableList<T> IImmutableList<T>.Replace(T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
abstract member System.Collections.Immutable.IImmutableList<T>.Replace : 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.IImmutableList<'T>
override this.System.Collections.Immutable.IImmutableList<T>.Replace : 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.IImmutableList<'T>
Function Replace (oldValue As T, newValue As T, equalityComparer As IEqualityComparer(Of T)) As IImmutableList(Of T) Implements IImmutableList(Of T).Replace

參數

oldValue
T

在陣列中尋找並替換的值。

newValue
T

用來取代的 oldvalue 價值。

equalityComparer
IEqualityComparer<T>

用來比較價值的等號比較器。

傳回

即使新舊值相同,也包含 newValue 新的陣列。

實作

例外狀況

oldValue 不在陣列中。

備註

此成員為明確介面成員實作。 它只能在實 ImmutableArray<T> 例投射到 IImmutableList<T> 介面時使用。

適用於