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
stackStack<T>The stack object.
valueToReplaceTValue to replace.
valueToReplaceWithTValue to replace with to what matches the value to replace.
comparerIEqualityComparer<T>The comparison object.
Type Parameters
TThe stack object type.