MoreEnumerableMoveT Method
Returns a sequence with a range of elements in the source sequence
moved to a new offset.
Namespace: MoreLinqAssembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
public static IEnumerable<T> Move<T>(
this IEnumerable<T> source,
int fromIndex,
int count,
int toIndex
)
<ExtensionAttribute>
Public Shared Function Move(Of T) (
source As IEnumerable(Of T),
fromIndex As Integer,
count As Integer,
toIndex As Integer
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Move(
IEnumerable<T>^ source,
int fromIndex,
int count,
int toIndex
)
[<ExtensionAttribute>]
static member Move :
source : IEnumerable<'T> *
fromIndex : int *
count : int *
toIndex : int -> IEnumerable<'T>
- source IEnumerableT
- The source sequence.
- fromIndex Int32
-
The zero-based index identifying the first element in the range of
elements to move.
- count Int32
- The count of items to move.
- toIndex Int32
-
The index where the specified range will be moved.
- T
- Type of the source sequence.
IEnumerableT
A sequence with the specified range moved to the new position.
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).
This operator uses deferred execution and streams its results.
var result = Enumerable.Range(0, 6).Move(3, 2, 0);
The
result variable will contain
{ 3, 4, 0, 1, 2, 5 }.