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.

Microsoft Documentation

An Example:

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.

--

--

--

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

I made Semantic Versioning easy

Edge Computing: The Future of Cloud

Edge Computing, Cloud Computing, Edge vs Cloud, Edge, Cloud Computing

How to Use Custom Font Google Fonts in Flutter

The Case of The Unexplained “TaskCanceledException” and Docker Broken Promise “works on my machine”?

UPVC Soffits in Blaenau Gwent #UPVC #Soffit #Installation #Blaenau #Gwent https://t.co/CB00XeIEar

An Internship of Firsts

Create your github portfolio easily!

Exposing our applications with GCLB and Istio

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vincent Taylor

Vincent Taylor

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.

More from Medium

What Is C# LINQ?

Find the first date of a week from a given date In C#

Working with XML — .NET Objects

C# — switch expression ; switch statement — Whats comming on?