Results 1 to 4 of 4

Thread: Resolved: reference problem and using left function

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40

    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.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    you need to look at the SubString property , it replaces the Left function. eg:
    VB Code:
    1. [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]
    2.         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]

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    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/

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40
    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
  •  



Click Here to Expand Forum to Full Width