Solved

StringTokenizer

Posted on 2006-06-08
4
203 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
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
Comment Utility
its for breaking strings into tokens

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

Author Comment

by:jedistar
Comment Utility
thanks, how does it define the separater
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
0
 
LVL 26

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now