[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java - String Token

Posted on 2006-11-03
1
Medium Priority
?
234 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 120 total points
ID: 17872018
String str = "username:password,security question,security answer";
            StringTokenizer stk = new StringTokenizer(str,":,"); //tokenize by : and ,

~marchent~
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month18 days, 8 hours left to enroll

825 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