Re: Java StreamTokenizer
- From: jeremiah johnson <jjohnson@xxxxxxx>
- Date: Fri, 29 Apr 2005 02:29:25 GMT
Everything you get from the STRINGTokenizer will be a string.
int oneTwoThreeFour = Integer.parseInt(token);
If you want to do that only for strings, use java.text.RegularExpressions to only convert tokens that are 100% numeric.
absinth@xxxxxxxxx wrote:
Hi,
The StreamTokenizer is perfect for what I want to do but am wondering, how can I make the Tokenizer recognise another escape character apart from '\'?
Also does anyone have any idea on how to have the tokenizer parse in white space into strings?
For example say I delimit a field with |: Hello World|1234
I want the tokenizer to parse in "Hello World" as a string token and "1234" as an integer.
.
- Follow-Ups:
- Re: Java StreamTokenizer
- From: absinth
- Re: Java StreamTokenizer
- References:
- Java StreamTokenizer
- From: absinth
- Java StreamTokenizer
- Prev by Date: Re: Cross tabulation - someone please help if you can
- Next by Date: hindi unicode works but tamil does not ??
- Previous by thread: Java StreamTokenizer
- Next by thread: Re: Java StreamTokenizer
- Index(es):
Relevant Pages
|
|