Solved

StringTokenizer

Posted on 2006-06-08
4
209 Views
Last Modified: 2010-03-31
Trying to do some io here.

What is StringTokenizer for and hasmoretokens etc?
How do i use them..examples?
0
Comment
Question by:jedistar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 16866737
its for breaking strings into tokens

http://javaalmanac.com/egs/java.util/ParseString.html
0
 

Author Comment

by:jedistar
ID: 16866774
thanks, how does it define the separater
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 16866812
String aString = "word1#word2#word3";
    StringTokenizer parser = new StringTokenizer(aString, "#"); //# is the delim here!
    while (parser.hasMoreTokens()) {
        processWord(parser.nextToken());
    }
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question