I am trying to Split a collection of comma seperated value strings within a for loop. Using Debug after each split, it appears only the first Split gets all 14 entries of the csv. Subsequent loops display only a couple of the values after the Split. Attaching the following script to an empty game object will show these unwelcome results in the console. Is this a bug in Unity? Must I look up each comma individually and use Substring to split? Thanks!
var arrayMapItemsAll = new Array();
arrayMapItemsAll.Add("28,107,39,3,http://gqassets.s3.amazonaws.com/healthy_start.unity3d,1310769976,1394,-1.875~0~-4.375,1,1,0,0,0,0");
arrayMapItemsAll.Add("28,107,39,1,http://gqassets.s3.amazonaws.com/healthy_start.unity3d,1310769976,1393,-4.375~0~-4.375,1,1,0,0,0,0");
arrayMapItemsAll.Add("28,116,39,1,http://gqassets.s3.amazonaws.com/dead_start.unity3d,1310770799,1393,-4.375~0~-4.375,1,1,0,0,0,3");
arrayMapItemsAll.Add("99,116,39,1,http://gqassets.s3.amazonaws.com/dead_start.unity3d,1310770799,1395,-4.375~0~-4.375,1,1,0,0,0,3");
function Start () {
for (var i=0; i < arrayMapItemsAll.length; i++) {
var det1 : String[] = arrayMapItemsAll*.Split(","[0]);*
Debug.Log("arrayMapItemsAll length Verify it is 14 = " + det1.length);
Debug.Log("det1[0] = "+det1[0]);
Debug.Log("det1[1] = "+det1[1]);
Debug.Log("det1[2] = "+det1[2]);
Debug.Log("det1[3] = "+det1[3]);
Debug.Log("det1[4] = "+det1[4]);
Debug.Log("det1[5] = "+det1[5]);
Debug.Log("det1[6] = "+det1[6]);
Debug.Log("det1[7] = "+det1[7]);
Debug.Log("det1[8] = "+det1[8]);
Debug.Log("det1[9] = "+det1[9]);
Debug.Log("det1[10] = "+det1[10]);
Debug.Log("det1[11] = "+det1[11]);
Debug.Log("det1[12] = "+det1[12]);
Debug.Log("det1[13] = "+det1[13]);
}
}