Table of Contents

Method Swap

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Swap<T>(Stack<T>, T, T, IEqualityComparer<T>)

Swap two stack objects values that matches with the both values.

public static void Swap<T>(this Stack<T> stack, T valueToSwapFrom, T valueToSwapTo, IEqualityComparer<T> comparer = null)

Parameters

stack Stack<T>

The stack object.

valueToSwapFrom T

Value to swap from.

valueToSwapTo T

Value to swap to.

comparer IEqualityComparer<T>

The comparison object.

Type Parameters

T

The stack object type.