num is called the range variable which will take turns representing each value in the array.
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
Related examples in the same category