Solved

Java - String Token

Posted on 2006-11-03
1
213 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Title # Comments Views Activity
varialbe initialization 11 37
hibernate jars 4 45
jsp insert to database example 2 47
sql import cannot be resolved jsp 3 49
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

831 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