Solved

Java - String Token

Posted on 2006-11-03
1
207 Views
Last Modified: 2010-03-31
Hi!
I have a text file with the following values.

username:password,security question,security answer

Using string token, i do manage to read in username and password via bufferreader.
But my problems comes when reading security question as it is delimited by a "," instead of a ":"

Is there a way during my buffer reader, read in both : and ,?

Else, how am i going to read my security question and answer.

Any solutions would be great.
Cheers!
Darence
0
Comment
Question by:darence
1 Comment
 
LVL 13

Accepted Solution

by:
marchent earned 30 total points
ID: 17872018
String str = "username:password,security question,security answer";
            StringTokenizer stk = new StringTokenizer(str,":,"); //tokenize by : and ,

~marchent~
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

744 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

14 Experts available now in Live!

Get 1:1 Help Now