स्किप () विधि का उपयोग करके तत्वों को छोड़ें और शेष तत्वों को वापस करें।
निम्नलिखित एक सरणी है।
int[] marks = { 80, 55, 79, 99 }; अब, लैम्ब्डा एक्सप्रेशन का उपयोग करके 2 तत्वों को छोड़ दें, लेकिन यह तत्वों को अवरोही क्रम में व्यवस्थित करने के बाद किया जाता है।
IEnumerable<int> selMarks = marks.AsQueryable().OrderByDescending(s => s).Skip(2);
उदाहरण
using System;
using System.Linq;
using System.Collections.Generic;
public class Demo {
public static void Main() {
int[] marks = { 80, 55, 79, 99 };
IEnumerable<int> selMarks = marks.AsQueryable().OrderByDescending(s => s).Skip(2);
Console.WriteLine("Skipped the result of 1st two students...");
foreach (int res in selMarks) {
console.WriteLine(res);
}
}
}