{TOC}
| Namespace: | System.Linq |
| Assembly: | System.Core.dll |
| Extends: | IEnumerable<T> |
Back to
Standard Query Operator IndexEditIntroduction
The Skip operator skips a given number of elements from a sequence and then yields the remainder of the sequence.
EditMethod Signatures
public static IEnumerable<TSource> Skip<TSource>(
this IEnumerable<TSource> source,
int count)EditExceptions
Throw an ArgumentNullException if
source is null.
EditPseudo-code
If
source is null, throw an ArgumentNullException.
Iterate the
source sequence.
If count > 0, decrement count by one.
If
count <= 0.
Resume iterating source from the point we skipped to.
Return the current element. Resume execution from this point when the next element is requested.
Note: If
count < 0, all records are returned.
Note: If
count is greater than the number of elements in
source, then no elements are returned.
EditLoop Count
Initially,
count number of records are enumerated over with no result returned. This operator implements the standard
deferred execution iterator pattern. This means, no looping will occur until the result is iterated over.
EditCode Samples
TODO: Needs code sample.