C# LINQ — “Skip(While)”
LINQ (Language-Integrated Query) is a set of integrated C# capabilities which allow queries against data.
Today’s Objective: Look at the LINQ Skip method, and its uses in game development.
The LINQ Skip Method:
A straightforward method, the Skip method simply creates a new collection which is a duplicate of the original, except it skips the specified number of entries from the beginning.
This example shows how you could quickly get the top three grade scores from a numeric collection. While there are smarter ways to achieve this particular goal, this is a viable solution depending on your needs, and the Skip method is useful in many situations.
There are also variations such as SkipWhile(condition) and SkipLast(number) which have slightly different effects.