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
Syntaxpublic 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>
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.
Examplesvar result = Enumerable.Range(0, 6).Move(3, 2, 0);
The
result variable will contain
{ 3, 4, 0, 1, 2, 5 }.
See Also