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> 介面時,才能使用這個成員。

適用於