Click or drag to resize

ExtensionsSwapT Method

Swaps two elements in a collection

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static IList<T> Swap<T>(
	this IList<T> collection,
	T a,
	T b
)

Parameters

collection
Type: System.Collections.GenericIListT
The collection where the elements should be swaped
a
Type: T
The first element to swap
b
Type: T
The second element to swap with

Type Parameters

T
The type that is contained in the collection

Return Value

Type: IListT
The collection

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IListT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also