Using an indexed Select clause to determine if the value of Integers match their position
Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq
Public Class MainClass
Public Shared Sub Main
Dim numbers As Integer() = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}
Dim numsInPlace = numbers.Select(Function(num, index) New With {.Num = num, .InPlace = (num = index)})
Console.WriteLine("Number: In-place?")
For Each n In numsInPlace
Console.WriteLine(n.Num & ": " & n.InPlace)
Next
End Sub
End Class
Related examples in the same category