Table of Contents

Method Replace

Namespace
GuildWars2.Collections
Assembly
GuildWars2.dll

Replace(T, T, IEqualityComparer<T>?)

Returns a new list with the first matching element in the list replaced with the specified element.

IImmutableValueList<T> Replace(T oldValue, T newValue, IEqualityComparer<T>? equalityComparer)

Parameters

oldValue T

The element to be replaced.

newValue T

The element to replace the first occurrence of oldValue with.

equalityComparer IEqualityComparer<T>

The equality comparer to use for matching oldValue.

Returns

IImmutableValueList<T>

A new list that contains newValue, even if oldvalue is the same as newValue.

Exceptions

ArgumentException

oldValue does not exist in the list.