Mega Code Archive

 
Categories / VB.Net / LINQ
 

Indexed Where

Imports System.IO Imports System.Reflection Imports System.Linq Imports System.Xml.Linq Public Class MainClass    Public Shared Sub Main         Dim digits = New String() {"zero", "one", "two"}         Dim shortDigits = digits.Where(Function(digit, index) digit.Length < index)         Console.WriteLine("Short digits:")         For Each d In shortDigits             Console.WriteLine("The word " & d & " is shorter than its value.")         Next    End Sub End Class