CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Posts
    7

    How to convert s pure digit Sting to a Integer

    like convert "55" to Integer 55

    [email protected]


  2. #2
    Join Date
    Aug 2000
    Location
    England
    Posts
    185

    Re: How to convert s pure digit Sting to a Integer

    use Int, i.e Int("55")


  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: How to convert s pure digit Sting to a Integer

    dim strS as string
    dim intNumber as integer, lngNumber as long, dblNumber as double

    strS = "55"
    intNumber = Cint(strS)
    lngNumber =Clng(strS)
    dblNumber =Cdbl(strS)

    Have fun.


    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: How to convert s pure digit Sting to a Integer

    ... to tell the truth, my example was a little short:

    dim strS as string
    dim intNumber as integer, lngNumber as long, dblNumber as double

    strS = "55"
    if isnumeric(strS) then
    intNumber = Cint(strS)
    lngNumber =Clng(strS)
    dblNumber =Cdbl(strS)
    end if


    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured