VB.NET null coalescing operator? [duplicate]
Yes, there is, a long as you’re using VB 9 or later (included with Visual Studio 2008). You can use the version of the If operator overloaded to accept only two arguments: Dim myVar? As Integer = Nothing Console.WriteLine(If(myVar, 7)) More information can be found here in a blog post by the VB.NET team. (Yes, … Read more