|
-
Oct 30th, 2001, 02:59 PM
#1
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.
-
Oct 30th, 2001, 03:15 PM
#2
Arien I am sure than you understand me
-
Oct 30th, 2001, 04:25 PM
#3
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
-
Oct 30th, 2001, 06:39 PM
#4
big thx but how can i change the for "," and for ";" instead of space ?
-
Oct 30th, 2001, 06:43 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|