This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes StringTokenizer and Loop Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "StringTokenizer and Loop Help" Watch "StringTokenizer and Loop Help" New topic
Author

StringTokenizer and Loop Help

Zoe Peng
Ranch Hand

Joined: Nov 27, 2000
Posts: 112
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()
};
 
wood burning stoves
 
subject: StringTokenizer and Loop Help
 
Similar Threads
can I do loop inside jsp:include
How to split string in JSP?
Help...StringTokenizer
Help....StringTokenizer
String Tokenizer - getting the 10 th Token