dcsimg
 

Submitted by: Srinath M S(srinath_ms@yahoo.com)

Thursday Sep 12th 2019 by Srinath M S

Language: .NET, Expertise: Intermediate - Explore how to use a simple statement to pick the first few elements of an array in C#.

Using the Take operator, we can pick the first few elements of an array with a simple statement like this:

int n = 3;
var firstThreeStates = states.Take(n);
Home
Mobile Site | Full Site