how do i split the code into three items
reading the data and dumping into String of Array
:
String[] songs_array = directory_listings.split(":::");
here is the restultset looks like:
:::Chapter 01>>>Name of the Book>>>Spanish name:::
and once its in songs_array
variable i would like to do similar to like this: but the above code just return me a string :::Chapter 01>>>Name of the Book>>>Spanish name:::
m_orders = new ArrayList<Order>();
Order obj = new Order();
obj.ChapterNumber(songs_array[0]);
obj.EnglishName(songs_array[0][1]);
obj.SpanishName(songs_array[0][1][2]);
m_orders.add(obj);
any help?
Something along these lines I would imagine.
ReplyDeleteString[] songs_array = directory_listings.Split(":::");
var m_orders = new List<Order>();
for (int i = 0; i < songs_array.Length; i++)
{
var song = songs_array[i].Split(">>>");
m_orders.Add(new Order()
{
ChapterNumber = song[0],
EnglishName = song[1],
SpanishName = song[2]
});
}