Imports System
Imports System.Linq
Imports System.Collections.Generic
Public Class Program
Public Shared Sub Main()
Dim Has4Letters As Func(Of String, Boolean) = Function(str) str.Length = 4
Dim words As String() = {
"play", "sing", "sci", "fi", "game", "pro",
"dev", "five", "moon", "c#", "net", "cool", "programming"
}
Dim FourLetterWords As IEnumerable(Of String) = words.Where(Has4Letters)
For Each word In FourLetterWords
Console.WriteLine(word)
Next
End Sub
End Class
' run:
'
' play
' sing
' game
' five
' moon
' cool
'