ImmutableArray<T>::Replace Method (T, T)

 

Finds the first element in the array equal to the specified value and replaces the value with the specified new value.

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
ImmutableArray<T> Replace(
	T oldValue,
	T newValue
)

Parameters

oldValue
Type: T

The value to find and replace in the array.

newValue
Type: T

The value to replace the oldvalue with.

Return Value

Type: System.Collections.Immutable::ImmutableArray<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.

Return to top
Show: