Results 1 to 3 of 3

Thread: need help..

  1. #1
    ras_pari is offline Member
    Join Date
    Oct 2009
    Posts
    40
    Rep Power
    0

    Angry need help..

    hi..
    I have a number like this 12:3:4.Now I have 2 thake out individual digit of this number seprated by ":".for ex.12,3,4.how 2 do this?plz help me!!!

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,535
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ras_pari View Post
    hi..
    I have a number like this 12:3:4.Now I have 2 thake out individual digit of this number seprated by ":".for ex.12,3,4.how 2 do this?plz help me!!!
    Read the API documentation for the String.split( ... ) method and the Integer.parseInt( ... ) method.

    kind regards,

    Jos

    ps. don't write '2' for 'to' or 'plz' unless you've typed your message on a cell phone.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    When you are trying to do such things try to avoid StringTokenizer as much as possible, which is not safer to use. split() from String class is fine. Give a try and let us know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •