নিচে আমাদের অ্যเรটি দেওয়া হলো −
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7};
প্রথম উপাদান পেতে, First() মেথডটি ব্যবহার করুন।
myArr.AsQueryable().First();
সম্পূর্ণ কোডটি দেখি −
উদাহরণ
using System;
using System.Linq;
using System.Collections.Generic;
class Demo {
static void Main() {
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7};
double res = myArr.AsQueryable().First();
Console.WriteLine(res);
}
}
আউটপুট
20.5