প্রথমত, একটি স্ট্রিং অ্যারে সেট করুন৷
৷string[] num = { "One", "Two", "Three", "Four", "Five"}; উপাদান গণনা পেতে Linq LongCount পদ্ধতি ব্যবহার করুন।
num.AsQueryable().LongCount();
এখানে সম্পূর্ণ কোড −
উদাহরণ
using System;
using System.Collections.Generic;
using System.Linq;
class Demo {
static void Main() {
string[] num = { "One", "Two", "Three", "Four", "Five"};
long res = num.AsQueryable().LongCount();
Console.WriteLine("{0} elements", res);
}
} আউটপুট
5 elements