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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -