What is the VB.NET equivalent of the C# “is” keyword?
Try the following if TypeOf x Is IFoo Then …
Try the following if TypeOf x Is IFoo Then …
If using Visual Studio 2010 or later you should use the FROM keyword like this: Dim days = New Dictionary(Of Integer, String) From {{0, “string”}, {1, “string2”}} See: http://msdn.microsoft.com/en-us/library/dd293617(VS.100).aspx If you need to use a prior version of Visual Studio and you need to do this frequently you could just inherit from the Dictionary class … Read more
No, there is no equivalent of the out keyword in VB. However, VB does automatically initialise all local variables in a method, so you can use ByRef without needing to explicitly initialise the variable first. Example: Sub Main() Dim y As Integer Test(y) End Sub Sub Test(ByRef x As Integer) x = 42 End Sub … Read more