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>,才能使用它。

适用于