Mega Code Archive

 
Categories / VB.Net / LINQ
 

Using Select to produce a sequence of each word in an array with new case

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 word In words _                               Select Upper = word.ToUpper(), Lower = word.ToLower()         For Each ul In upperLowerWords             Console.WriteLine("Uppercase: " & ul.Upper & ", Lowercase: " & ul.Lower)         Next             End Sub End Class