|
-
Jan 25th, 2008, 02:39 PM
#1
Thread Starter
Hyperactive Member
StringTokenizer Issue
Here is the code im working with:
Code:
int i=0;
String iLine = in.readLine();
// Tokenize
st = new StringTokenizer(iLine,",");
while (st.hasMoreTokens()) {
r[i] = st.nextToken();
i++;
}
Here is the Data Im working with:
Hilton,15,,2,,
The tokens Im getting are as follows:
Hilton
15
2
But what I need is
Hilton
15
2
I need to get that blank token, how can I get it?
Thanks!
-
Jan 25th, 2008, 05:09 PM
#2
Thread Starter
Hyperactive Member
Re: StringTokenizer Issue
-
Jan 26th, 2008, 09:46 AM
#3
Re: StringTokenizer Issue
or you can use the String.split method instead
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
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
|