Click or drag to resize

MoveExtension.Move<T> Method

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

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

Parameters

source
Type: System.Collections.Generic.IEnumerable<T>
The source sequence.
fromIndex
Type: System.Int32
The zero-based index identifying the first element in the range of elements to move.
count
Type: System.Int32
The count of items to move.
toIndex
Type: System.Int32
The index where the specified range will be moved.

Type Parameters

T
Type of the source sequence.

Return Value

Type: IEnumerable<T>
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 IEnumerable<T>. 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