Javatpoint Logo
Javatpoint Logo

LINQ Empty Method

In LINQ, the Empty method or operator is used to return the empty sequence of the collection.

Syntax of LINQ Empty Method

Here is the syntax of the LINQ Empty method to generate the collection with an empty sequence.

In the above syntax, we defined the Empty() method to generate an empty sequence.

Example of LINQ Empty Method

Here is the example of the LINQ Empty Method to generate the collection, which contains the empty sequence.

In the above example, we defined the Empty method to generate an empty sequence. If we run the above example, we will get empty results. This is the way how we can use the LINQ Empty() method to generate the empty sequence of the collection.

Output:

LINQ Empty Method
Next TopicLINQ Cast() Method




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA