Skip() পদ্ধতি ব্যবহার করে উপাদান বাদ দিয়ে বাকি উপাদানগুলো ফেরত পান।
নিচে একটি অ্যারে দেওয়া হলো।
int[] marks = { 80, 55, 79, 99 };এখন, ল্যাম্বডা এক্সপ্রেশন ব্যবহার করে ২টি উপাদান বাদ দিন, কিন্তু এটি উপাদানগুলো অবরোহক্রমে সাজানোর পরে করা হবে।
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); } } }