Java - String Token

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
darenceAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
marchentConnect With a Mentor Commented:
String str = "username:password,security question,security answer";
            StringTokenizer stk = new StringTokenizer(str,":,"); //tokenize by : and ,

~marchent~
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.