Results 1 to 5 of 5

Thread: Vb split in Java ?

  1. #1
    DaoK
    Guest

    Vb split in Java ?

    I need to take stuff between "," in a string.


    The string is : transact:5,5,90;7,1,-140;7,2,70;10,1,-30;15,4,10;15,4,10;16,4,300;20,6,-80;23,4,200;,27,3,-100;28,1,65;0

    like you can see they are splitted by "," and ";" and I need to split that in group of three and after split all again to have for final result : something like that :

    5
    5
    90

    7
    1
    -140

    7
    2
    70

    ....

    I have tryed to make a For statement :

    Code:
          for (int i=9;i < sTransac.length ();i++)
          {
            if (sTransac.charAt(i) == sTransac.compareTo (";")  )
            {
              iLeBon=i;
              //This code is just to find the value of the ";" but it don't work
            }
          }
    Can any one can help me please.

  2. #2
    DaoK
    Guest
    Arien I am sure than you understand me

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    use a StringTokenizer.

    Here is the Java documentation...
    http://java.sun.com/j2se/1.3/docs/ap...Tokenizer.html

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    DaoK
    Guest
    big thx but how can i change the for "," and for ";" instead of space ?

  5. #5
    DaoK
    Guest
    System.out.println(st.nextToken(","));

    ok i found it Big thx Blade you are cool dude

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