MoreEnumerable.Insert<T> Method |
Inserts the elements of a sequence into another sequence at a
specified index.
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.2.0+5205ea241d72b079436060d330cd5c2eae7cdcdf
Syntaxpublic static IEnumerable<T> Insert<T>(
this IEnumerable<T> first,
IEnumerable<T> second,
int index
)
<ExtensionAttribute>
Public Shared Function Insert(Of T) (
first As IEnumerable(Of T),
second As IEnumerable(Of T),
index As Integer
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Insert(
IEnumerable<T>^ first,
IEnumerable<T>^ second,
int index
)
[<ExtensionAttribute>]
static member Insert :
first : IEnumerable<'T> *
second : IEnumerable<'T> *
index : int -> IEnumerable<'T>
Parameters
- first
- Type: System.Collections.Generic.IEnumerable<T>
The source sequence. - second
- Type: System.Collections.Generic.IEnumerable<T>
The sequence that will be inserted. - index
- Type: System.Int32
The zero-based index at which to insert elements from
second.
Type Parameters
- T
- Type of the elements of the source sequence.
Return Value
Type:
IEnumerable<T>
A sequence that contains the elements of
first
plus the elements of
second inserted at
the given index.
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).
Exceptions
See Also