ImmutableArray<T>.IImmutableList<T>.Replace(T, T, IEqualityComparer<T>) メソッド

定義

指定された値と等しい、配列内の最初の要素を検索して、その値を、指定した新しい値に置き換えます。Finds the first element in the array equal to the specified value and replaces the value with the specified new value.

 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

配列内で検索して置換する値。The value to find and replace in the array.

newValue
T

oldvalue を置き換える値。The value to replace the oldvalue with.

equalityComparer
IEqualityComparer<T>

値の比較に使用する等値比較子。The equality comparer to use to compare values.

戻り値

IImmutableList<T>

新しい値と古い値が同じ場合でも、newValue が格納されている新しい配列。A new array that contains newValue even if the new and old values are the same.

実装

例外

oldValue が配列内に見つかりません。oldValue is not found in the array.

注釈

このメンバーは、明示的なインターフェイス メンバーの実装です。This member is an explicit interface member implementation. これは、ImmutableArray<T> のインスタンスが IImmutableList<T> インターフェイスにキャストされる場合のみ、使用できます。It can be used only when the ImmutableArray<T> instance is cast to an IImmutableList<T> interface.

適用対象