In LINQ, Partition Operators are used for separating the given sequence into two portions without
Sorting the element and return the one of the portions
|
Method |
Description |
|
Skip |
This operator is used to skip the specified number of elements in a sequence return the remaining elements. |
|
SkipWhile |
This operator is used to skip the elements in a sequence based on the condition, Which is defined as true |
|
Example: Skip() Method – C# |
|
IList<string> strList = new List<string>(){"Hindi", "Marathi", "Math", "Science"}; var newList = strList.Skip(2); foreach(var str in newList) Console.WriteLine(str); |
|
Output - |
|
Math Science |
|
Example: SkipWhile() Method – C# |
IList
varforeach
|
|
Output - |
|
Three |


No comments:
Post a Comment