Method Replace
Replace<T>(Stack<T>, T, T, IEqualityComparer<T>)
Replaces a stack object values that match with the value to replace.
public static void Replace<T>(this Stack<T> stack, T valueToReplace, T valueToReplaceWith, IEqualityComparer<T> comparer = null)
Parameters
stack
Stack<T>The stack object.
valueToReplace
TValue to replace.
valueToReplaceWith
TValue to replace with to what matches the value to replace.
comparer
IEqualityComparer<T>The comparison object.
Type Parameters
T
The stack object type.