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
oldValueTThe element to be replaced.
newValueTThe element to replace the first occurrence of
oldValuewith.equalityComparerIEqualityComparer<T>The equality comparer to use for matching
oldValue.
Returns
- IImmutableValueList<T>
A new list that contains
newValue, even ifoldvalueis the same asnewValue.
Exceptions
- ArgumentException
oldValuedoes not exist in the list.