|
-
Mar 4th, 2005, 01:48 AM
#1
Thread Starter
Hyperactive Member
Left function
Hi,
In VB.NET, to use the Left function to extract characters from a string, I need to write:
Microsoft.VisualBasic.Strings.Left(strSomething, 5)
if just Left(strSomething, 5), it will points to Left of another Class.
This problem does not occur however for Mid() and Right() function.
Is there any way to eliminate this problem?
Thx~
-
Mar 4th, 2005, 03:53 AM
#2
Re: Left function
Those are old VB6 functions. Now we tend not to use them.
The Left you referred to is most likely the Left property of the Form you are working on, which will return an integer defining the horizontal position of the left edge of the form.
Lets say you want to grab the first 7 characters from "Hello World"...
MyString = "Hello World"
MyOtherString = Mystring.Substring(0,7)
'myotherstring now holds "Hello W"
I don't live here any more.
-
Mar 4th, 2005, 03:55 AM
#3
Re: Left function
In my projects, I always remove the Microsoft.VisualBasic namespace from the imports list (see the project properties dialog) and use Option Strict On for all my code.
These measures ensure better coding practices.
I don't live here any more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|