Table of Contents

Method Swap

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Swap<T>(ref T, ref T)

Exchanges the values of two variables of the same type.

public static void Swap<T>(ref T a, ref T b)

Parameters

a T

A reference to the first variable whose value will be exchanged.

b T

A reference to the second variable whose value will be exchanged.

Type Parameters

T

The type of the variables to swap.

Remarks

Both parameters must be of the same type. This method is useful for swapping values in place without requiring an additional temporary variable outside the method.