নিচে আমাদের অ্যারে দেওয়া হল:
int[] points = { 210, 250, 300, 350, 420};
উপাদান স্কিপ করতে Skip() পদ্ধতি ব্যবহার করুন। আর্গুমেন্ট হিসেবে সংখ্যাটি যোগ করুন যা কতগুলো উপাদান ফেরত দেওয়া হবে তা নির্দেশ করে।
IEnumerableskipEle = points.AsQueryable().OrderByDescending(s => s).Skip(3);
উদাহরণ
using System; using System.Linq; using System.Collections.Generic; public class Demo { public static void Main() { int[] points = { 210, 250, 300, 350, 420}; Console.WriteLine("Initial array..."); foreach (int res in points) Console.WriteLine(res); IEnumerable skipEle = points.AsQueryable().OrderByDescending(s => s).Skip(3); Console.WriteLine("Skipped 3 elements..."); foreach (int res in skipEle) Console.WriteLine(res); } }
আউটপুট
Initial array... 210 250 300 350 420 Skipped 3 elements... 250 210