VB.Net convert string to title case

Our advice is to create an extension, so you can directly use the new function on strings: Public Module MyExtensions <System.Runtime.CompilerServices.Extension()> Public Function ToTitleCase(mystring As String) As String Return System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(mystring) End Function End Module Now…

VB.net – Select Case

How to create a Switch (Select Case) in VB.Net: Select Case value Case 1 Console.WriteLine(“One”) Case 2 Console.WriteLine(“Two”) Case 3, 4 Console.WriteLine(“Three or four”) Case 5 To 10 Console.WriteLine(“From five to Ten”) Case Else Console.WriteLine(“Everything…

VB.Net Linq – Group By

Small piece of programming code in vb.net. How to Perform a Group By with LINQ. Dim Result = From p In Person Group p By MyGroup = New With { Key .Name = p.Name, Key…