Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stringtokenizer  RSS feed

 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while(st.hasMoreTokens())
{

value = st.nextToken();

}

/****question*************/
how do you compare individual values stored in value variable?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compare them to what? Each other? For that you'd have to keep a bunch of them around instead of just the one you assigned to value. Maybe an array? You can get the token count from the tokenizer and use that to initialize the array.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!