Results 1 to 3 of 3

Thread: parsing a text

  1. #1
    lemontree45 is offline Member
    Join Date
    Oct 2010
    Posts
    25
    Rep Power
    0

    Default parsing a text

    Hi,

    I have a string in this format


    Java Code:
    String a="1-12-3-10";
    I need to parse it in such a way that I can extract all the integers in it seperately into an array.

    Eg:

    Java Code:
    b[1]=1;
    b[2]=12;
    b[3]=3;
    b[4]=10;
    I tried using it using 'substring'.but couldn't find a right solution. Any sort of help is appreciated. Thanks in advance

    Regards

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    lemontree45 is offline Member
    Join Date
    Oct 2010
    Posts
    25
    Rep Power
    0

Similar Threads

  1. Replies: 1
    Last Post: 06-29-2011, 05:46 PM
  2. Problem in parsing text
    By holy.water in forum New To Java
    Replies: 11
    Last Post: 02-19-2011, 05:19 PM
  3. Replies: 0
    Last Post: 12-09-2010, 05:56 PM
  4. Parsing Text Files
    By coder09 in forum New To Java
    Replies: 6
    Last Post: 02-18-2009, 12:08 PM
  5. parsing/storing large text data
    By hkansal in forum New To Java
    Replies: 4
    Last Post: 10-19-2008, 06:34 PM

Posting Permissions

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