convert string to an array java

Convert string like "abc,etc,sdq,sds,dse" to an array of 5 strings using java?
Who is Participating?
Ajay-SinghConnect With a Mentor Commented:
Use split

String[] array = "abc,etc,sdq,sds,dse".split(",");
You need to use a StringTokenizer with a comma as the field separator.  Check it out here:

How to break a String into tokens with the StringTokenizer class
anup001Author Commented:
Thanks Ajay
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.