Click or drag to resize

MoreEnumerableMoveT Method

Returns a sequence with a range of elements in the source sequence moved to a new offset.

Namespace:  MoreLinq
Assembly:  MoreLinq (in MoreLinq.dll) Version: 3.0.0
Syntax
public static IEnumerable<T> Move<T>(
	this IEnumerable<T> source,
	int fromIndex,
	int count,
	int toIndex
)

Parameters

source
Type: System.Collections.GenericIEnumerableT
The source sequence.
fromIndex
Type: SystemInt32
The zero-based index identifying the first element in the range of elements to move.
count
Type: SystemInt32
The count of items to move.
toIndex
Type: SystemInt32
The index where the specified range will be moved.

Type Parameters

T
Type of the source sequence.

Return Value

Type: IEnumerableT
A sequence with the specified range moved to the new position.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. 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).
Remarks
This operator uses deferred execution and streams its results.
Examples
var result = Enumerable.Range(0, 6).Move(3, 2, 0);
The result variable will contain { 3, 4, 0, 1, 2, 5 }.
See Also