Using Quantifiers All to determine whether an array contains only odd numbers : All « LINQ « VB.Net Tutorial






Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq

Public Class MainClass
   Public Shared Sub Main

        Dim numbers() As Integer = {1, 2, 3, 4, 5, 6, 7}

        Dim onlyOdd = Aggregate num In numbers _
                      Into All(num Mod 2 = 1)

        Console.WriteLine("The list contains only odd numbers: " & onlyOdd)

   End Sub


End Class








12.5.All
12.5.1.Using Quantifiers All to determine whether an array contains only odd numbers