Aggregation
Aggregate, Average, Count, LongCount, Max, Min, Sum
Conversion
AsEnumerable, Cast, OfType, ToArray, ToDictionary, ToList, ToLookup
Element
ElementAt, ElementAtOrDefault, First, FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault
ElementAt
ElementAtOrDefault
First (simple)
First (conditional)
FirstOrDefault
Last
LastOrDefault (simple)
LastOrDefault (conditional)
Single
SingleOrDefault
Generation
DefaultIfEmpty, Empty, Range, Repeat
Grouping
GroupBy
Join
GroupJoin, Join
Ordering
OrderBy, OrderByDescending, Reverse, ThenBy, ThenByDescending
OrderBy (simple - numbers)
OrderBy (simple - dates)
OrderBy (simple - objects)
OrderByDescending
Reverse
ThenBy
ThenByDescending
Other
Concat, SequenceEqual, Zip
Partitioning
Skip, SkipWhile, Take, TakeWhile
Projection
Select, SelectMany
Quantifiers
All, Any, Contains
Restriction
Where
Set
Distinct, Except, Intersect, Union
Close
Skip: Skips specified number of elements in a collection.
Skip: Skips specified number of elements in a collection. |
Skip: Skips specified number of elements in a collection. |
This Lambda Expression sample skips first 4 words in array. |
This Lambda Expression sample skips first 4 words in array. |
// A Query Expression cannot be constructed for Skip() in C#. // Consider using a Lambda Expression instead.
Private Shared Sub Sample_Skip_Linq() Dim words As String() = {"one", "two", "three", "four", "five", "six"} Dim result = From n In words Skip 4 Debug.WriteLine("Skips the first 4 words:") For Each number As String In result Debug.WriteLine(number) Next End SubOutput:
Skips the first 4 words: five six
let Sample_Skip_Linq() = let words = [| "one"; "two"; "three"; "four"; "five"; "six" |] let result = query { for w in words do skip 4 } Debug.WriteLine(sprintf "Skips the first 4 words:") for word in result do Debug.WriteLine(sprintf "%s" word)Output:
Skips the first 4 words: five six
static void Sample_Skip_Lambda() { string[] words = { "one", "two", "three", "four", "five", "six" }; var result = words.Skip(4); Debug.WriteLine("Skips the first 4 words:"); foreach (string word in result) Debug.WriteLine(word); }Output:
Skips the first 4 words: five six
Private Shared Sub Sample_Skip_Lambda() Dim words As String() = {"one", "two", "three", "four", "five", "six"} Dim result = words.Skip(4) Debug.WriteLine("Skips the first 4 words:") For Each word As String In result Debug.WriteLine(word) Next End SubOutput:
Skips the first 4 words: five six
let Sample_Skip_Lambda() = let words = [| "one"; "two"; "three"; "four"; "five"; "six" |] let result = words.Skip(4); Debug.WriteLine(sprintf "Skips the first 4 words:") for word in result do Debug.WriteLine(sprintf "%s" word)Output:
Skips the first 4 words: five six