Okay, just learning VB .NET migrating from VBA and VB 6.0. This should be super easy but I cant seem to get the LEFT Function to work. Does VB .NET support this?
Importing the namespace isn't necessary. The Imports statement is a sort of shortcut so that you don't have to type the namespace again and again. Although it would work.
You could do something like this:
VB.NET:
Dim str As String = Microsoft.VisualBasic.Left("Test", 2) ' str = "Te"
The more .NET way of doing that is to use the SubString Function of the String class. The above code would become:
VB.NET:
Dim str2 As String = "Test".Substring(0, 2) ' str2 = "Te"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.