-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Collections_QueryableExtensions_Slice__1
Extracts count elements from a sequence at a particular zero-based starting index.
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static IQueryable<T> Slice<T>(
this IQueryable<T> source,
int startIndex,
int count
)
VB
<ExtensionAttribute>
Public Shared Function Slice(Of T) (
source As IQueryable(Of T),
startIndex As Integer,
count As Integer
) As IQueryable(Of T)
F#
[<ExtensionAttribute>]
static member Slice :
source : IQueryable<'T> *
startIndex : int *
count : int -> IQueryable<'T>
- source
- Type: System.Linq.IQueryable(T)
The sequence from which to extract elements. - startIndex
- Type: System.Int32
The zero-based index at which to begin slicing. - count
- Type: System.Int32
The number of items to slice out of the index.
- T
- The type of the elements in the source sequence.
Type: IQueryable(T)
A new sequence containing any elements sliced out from the source sequence.
In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable(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).
If the starting position or count specified result in slice extending past the end of the sequence, it will return all elements up to that point. There is no guarantee that the resulting sequence will contain the number of elements requested - it may have anywhere from 0 to count.