Click or drag to resize

XListSwapT Method

Swaps the elements at the specified positions in the list.

Namespace:  Linq.Extras
Assembly:  Linq.Extras (in Linq.Extras.dll) Version: 5.0.0+96a4f4bfed64095342c5df107c1fe1fb95603ee5
Syntax
public static void Swap<T>(
	this IList<T> list,
	int index1,
	int index2
)

Parameters

list
Type: System.Collections.GenericIListT
The list in which to swap elements.
index1
Type: SystemInt32
The index of the first element to swap.
index2
Type: SystemInt32
The index of the second element to swap.

Type Parameters

T
The type of the elements in list.

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