How to split string in Java using comma?

Hi,

Share the example code for splitting the string in Java using comma as separator.

Thanks

View Answers

April 1, 2015 at 2:11 AM

Hi,

You can use the split() function of the String class to split the string.

Here is the code example that can be used:

String subStr[] = mystring.split(",");

You can check the thread How to split string in Java?.

Thanks









Related Tutorials/Questions & Answers:
Advertisements