অ্যারেতে TrueForAll() পদ্ধতির সাথে, আপনি একটি শর্তের জন্য প্রতিটি উপাদান পরীক্ষা করতে পারেন।
আসুন একটি উদাহরণ দেখি -
উদাহরণ
using System;
using System.Text;
public class Demo {
public static void Main() {
int[] val = { 97, 45, 76, 21, 89, 45 };
// checking whether all the array element are more than one or not
bool result = Array.TrueForAll(val, res => res > 1);
Console.WriteLine(result);
}
} আউটপুট
True
অ্যারেতে TrueForAll() পদ্ধতির সাথে, আপনি একটি শর্তের জন্য প্রতিটি উপাদান পরীক্ষা করতে পারেন।
আসুন একটি উদাহরণ দেখি -
উদাহরণ
using System;
using System.Text;
public class Demo {
public static void Main() {
int[] val = { 97, 45, 76, 21, 89, 45 };
// checking whether all the array element are more than one or not
bool result = Array.TrueForAll(val, res => res > 1);
Console.WriteLine(result);
}
} আউটপুট
True