>I have an array list (laData) that I have parsed a CSV file into. I end up with the following:
>
>The first element of laData containes "test","test2"
>The 2nd element of laDAta containes "test3","test4"
>
>I want to be able to move through the arraylist, get the 2 fields from each element and work with them. I can't seem to find the proper method for doing this.
>
>I assumed a simple laData[0][0].tostring() would have returned "test". but no luck.
>
>Any ideas on this?
>
>thanks in advance
>
>Alan Wyne
First, it might be easier (and better performance?) to use either a string array or a String List class instead of an ArrayList filled with strings.
Try this:
foreach (string myRecord in laData.Items)
{
string[] myFields = myRecord.Split(',');
Msgbox(myFields[0]);
Msgbox(myFields[1]);
}