• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

StringTokenizer and Loop Help

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I have many Tokens that separate the string from values
How can I make String[] s2 {...} doing the loop but the st.nextToken always get the next Token to me?
if I take off while {..}, I just can get one token and server just response one result for me.
But, I hava many Tokens.. (
any ideas? How can I approach this?? Thanks..
/*****************************************/
String values = sb.toString();
StringTokenizer st = new StringTokenizer(values, ",");
while(st.hasMoreTokens())
{
String token = st.nextToken();
}
String[] s2 =
{
"param1", request.getParameter("param1"),
"param2", request.getParameter("param2"),
"param3", st.nextToken()
};
 
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic