java - String Tokenizer issue -



java - String Tokenizer issue -

am using string tokenizer delimit string response ^

12/30/2011 12:00:00 am^president^^^159^true^true^true^true^true^false^false^true^true^3/18/2011 12:00:00 am^true^jujama, inc.^^^^true^true

but problem when ^ delimiter consecutively skipping 1 , adding in array. want add together space if 2 ^delimiters comes.

how that?

my code is:

stringtokenizer tokens = new stringtokenizer(partid, "^"); while(tokens.hasmoretokens()){ string value=tokens.nexttoken(); uservalues.add(value); system.out.println("..."+value); }

user string.split("^") instead. split receives regex, can want within 1 line.

java stringtokenizer

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -