Agnes,
The Left function in .NET is Microsoft.VisualBasic.Strings.Left!
If you use Strings.Left you may want to use an Import alias on
Microsoft.VisualBasic.
Imports VB = Microsoft.VisualBasic
Dim myString As String
myString = VB.Left(myString, 5)
Especially in Window Forms, as Left is a property of Control.
An alternative to Microsoft.VisualBasic.Strings is the methods on String
itself (such as String.SubString). I normally use String.SubString instead
of Strings.Left, however both are equally valid.
The one caveat I recommend is do not mix the VB Strings functions with the
String methods, as VB Strings are 1 based indexes & the String methods are 0
based indexes.
I understand now, I will use substring instead.
Thanks ALL
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.