Results 1 to 5 of 5

Thread: convert a string to integer

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario, Canada
    Posts
    275

    convert a string to integer

    how do i convert a string to integer ???

  2. #2
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    wouldn't this do it?
    VB Code:
    1. IntNumber = CInt(StringNumber)
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  3. #3
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Re: convert a string to integer

    Originally posted by area91
    how do i convert a string to integer ???
    use the convert class

    dim num as string = "1234"
    Convert.ToInt16(num)

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Just adding yet another way:
    Int.Parse("mystring")

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by hellswraith
    Just adding yet another way:
    Int.Parse("mystring")
    so, ahem any performance difference/advantage between Parse, Cint() and Convert.ToWhatever?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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