Using 'Select New With' to create new objects
Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq
Public Class MainClass
Public Shared Sub Main
Dim words = New String() {"this", "test", "is"}
Dim upperLowerWords = From w In words _
Select New With {.Upper = w.ToUpper(), .Lower = w.ToLower()}
For Each ul In upperLowerWords
Console.WriteLine("Uppercase: " & ul.Upper & ", Lowercase: " & ul.Lower)
Next
End Sub
End Class
Related examples in the same category