উপাদানগুলি এড়িয়ে যান এবং Skip() পদ্ধতি ব্যবহার করে অবশিষ্ট উপাদানগুলি ফেরত দিন৷
৷নিম্নলিখিতটি একটি অ্যারে৷
৷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);
}
}
}