सरणियों में 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