My String look like this
String url = 'domain1/balabala.mp3,domain2/aaaaa.mp3,domain3/baaaaa.mp3';
I want out put Like this
String domain1 = 'domain1/balabala.mp3';
String domain2 = 'domain2/aaaaa.mp3';
String domain3 = 'domain3/baaaaa.mp3';
Ex: Where host name called 'domain1' get the link as String
EDITED: I dont Want Just a Array. I need Out put based on domain host name. All Answer is good. Pls check again.
This one Nearly Work but not i Expected..
String[] separated = CurrentString.split(",");
separated[0]; // this will contain "domain1"
separated[1];// this will contain "domain2"
But this one Not Based host name.. It just separate first ,second and third domain name