Results 1 to 3 of 3

Thread: VB.NET equivelent of chr$() and asc() ?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53

    VB.NET equivelent of chr$() and asc() ?

    Like the various uses of 'myString.substring' are used in vb.net instead of the old vb6 left, right and mid. Can someone tell me the vb.net version of, for example: chr$(34) and asc("Z"), thanks.

    I don't want to use the above, or bring in the vb namespace, I'd like to find the proper vb.net way of doing them.

    Thanks

  2. #2
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    you can use chr$ but just drop the $ so it is simple

    VB Code:
    1. strItem =  chr(128)

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53
    I know.

    What I meant was I wanted the .NET equivelent. If I'm learning .NET then I'd rather use all the .NET syntax/commands where appropiate.

    Anyway, I found out how to do it:

    VB6 - Chr$(34)
    VB.NET - Convert.ToChar(34)

    VB6 - Asc("Z")
    VB.NET - Convert.ToByte("Z"c)

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