Need help in converting a String to int

Discussion in 'General Computer Support' started by techie, Nov 16, 2007.

  1. techie

    techie

    Joined:
    Nov 16, 2007
    Messages:
    1
    I want to convert a string= "005" to int and retain the 00 too.
    Integer.paseInt() removes the leading zeroes.

    Please help.
     
    techie, Nov 16, 2007
    #1
    1. Advertising

  2. techie

    iPhenom

    Joined:
    Nov 24, 2007
    Messages:
    4
    not good but ll work

    i know this solution is not so good but it ll work

    take out the digits individually by charAt() or substr() and then parse to int.
     
    iPhenom, Nov 24, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Perdition
    Replies:
    16
    Views:
    1,015
    Rex Johnson
    Nov 19, 2005
  2. newasp.net
    Replies:
    1
    Views:
    1,670
    imransyed63
    Aug 21, 2008
  3. pooja
    Replies:
    0
    Views:
    1,215
    pooja
    Mar 3, 2009
  4. kendarak
    Replies:
    0
    Views:
    1,152
    kendarak
    Jul 12, 2009
  5. koushik

    converting String to vector

    koushik, Aug 23, 2011, in forum: Software
    Replies:
    0
    Views:
    1,050
    koushik
    Aug 23, 2011
Loading...

Share This Page