Is there a VB.NET equivalent to the C# var
keyword?
I would like to use it to retrieve the result of a LINQ query.
Option Infer must be on in order for this to function properly. If so, then omitting the type in VB.NET (Visual Basic 9) will implicitly type the variable.
This is not the same as "Option Strict Off" in previous versions of VB.NET, as the variable is strongly-typed; it's just done so implicitly (like the C# var
) keyword.
Dim foo = "foo"
foo
is declared as a String
.