|
-
Oct 12th, 2003, 07:17 AM
#1
Thread Starter
Member
Resolved: reference problem and using left function
Hello,
When I use the left("mystring",5) function in vb.net I have to call for the function by using following code.
strMyResult = microsoft.visualbasic.left("mystring",5)
Is it possible to reference tot the microsoft.visualbasic namespace?
That way I would only have to write :
strMyResult = left("mystring",5)
I tried doing so with the statement
imports microsoft.visualbasic, but that didn't work.
Then I tried to find the reference by adding a reference, but I could not find the reference to microsoft.visualbasic.
The only reference I found was microsft.visualbasic.vsa.
Anyone know a sollution?
Greets,
J@B@r
Last edited by J@b@r; Oct 12th, 2003 at 10:24 AM.
-
Oct 12th, 2003, 07:25 AM
#2
you need to look at the SubString property , it replaces the Left function. eg:
VB Code:
[color=blue]Dim[/color] strMyResult [color=blue]As String[/color] = "mystring".Substring(0, 5) [color=green]'/// use Substring property to get the left / chars you need.[/color]
MessageBox.Show(strMyResult)
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 12th, 2003, 07:43 AM
#3
yay gay
dont look at substring as a left function but yes as a mid() function but starting at 0 and not at 1 like vb6 one did
\m/  \m/
-
Oct 12th, 2003, 10:24 AM
#4
Thread Starter
Member
Thanks for the replies,
The substring function does the trick.
Greets,
J@B@R
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
|