Returns all the numbers in an array that are less than 5. : Select « 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 = New Integer() {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
        Dim lowNums = From num In numbers Where num < 5 Select num
        Console.WriteLine("Numbers < 5:")
        For Each lowNumber In lowNums
            Console.WriteLine(lowNumber)
        Next
   
   End Sub


End Class








12.2.Select
12.2.1.Returns all the numbers in an array that are less than 5.
12.2.2.Generation Operators Range
12.2.3.Uses the new ternary If operator to return "odd" or "even"