ImmutableArray<T>::IImmutableList<T>::Replace Method (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.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
private: virtual IImmutableList<T>^ Replace( T oldValue, T newValue, IEqualityComparer<T>^ equalityComparer ) sealed = IImmutableList<T>::Replace
Parameters
- oldValue
-
Type:
T
The value to find and replace in the array.
- newValue
-
Type:
T
The value to replace the oldvalue with.
- equalityComparer
-
Type:
System.Collections.Generic::IEqualityComparer<T>^
The equality comparer to use to compare values.
Return Value
Type: System.Collections.Immutable::IImmutableList<T>^A new array that contains newValue even if the new and old values are the same.
| Exception | Condition |
|---|---|
| ArgumentException | oldValue is not found in the array. |
This member is an explicit interface member implementation. It can be used only when the ImmutableArray<T> instance is cast to an IImmutableList<T> interface.
Show: