Javatpoint Logo
Javatpoint Logo

LINQ SKIP OPERATOR

In LINQ, the Skip operator is used to skip the specified number of elements from the list/collection and return the remaining elements.

Syntax of LINQ Skip Operator

The syntax of using the LINQ Skip Operator is used to skip the specified number of elements from the collection and return the remaining elements from the collection.

C# Code

From the above syntax, we are skipping the first three elements by using the "Skip (3)" and getting the remaining elements from the collection.

Example of LINQ Skip Operator in Method Syntax

Here is the example of using the LINQ Skip operator in method syntax to skip the specified elements from the collection and getting the remaining elements from the collection.

In the above example, we are trying to skip the first three countries. So we passed "3" as an input parameter with the help of SKIP operator. It will display the rest of the country.

OUTPUT:

The result of using the skip operator in LINQ to skip some elements in the list as shown below.

LINQ Skip Operator

Example of LINQ Skip operator in Query Syntax

C# Code

OUTPUT:

LINQ Skip Operator




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA