Solved

StringTokenizer

Posted on 2006-06-08
4
208 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 92

Expert Comment

by:objects
ID: 16866785
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

733 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