First, I have a string that contain all of characters and then I add it into Arraylist of list1 but I separate it with *. so now I have 5 elements of arraylist.
String fString = "DAVCFW_ACK*DAVCFW_20_30_90*DAVCFW_15.5_20.1_35.0*DAVCFW_40_230_110*DAVCFW_END";
ArrayList list1 = new ArrayList();
string[] words = fString.Split('*');
foreach (string s in words)
{
list1.Add(s);
}
Second, I delete first 6 charecters of each elements and keep it into Arraylist of list2.
ArrayList list2 = new ArrayList();
String s1 = list1.ToString();
foreach(string s in list1){
for (int i = 0; i < s.Length; i++ ){
if(i>6){
list2[i-7] = list1[i];
}
}
}
Third, I delete all _ characters of each elemeant and keep it into Arraylist of list3. Now I get only number not characters.
ArrayList list3 = new ArrayList();
String[] word_s1 = s1.Split('_');
foreach(string s in word_s1){
list3.Add(s);
}
And then I would like to keep the value of list3 like matrix but still is an Arraylist. I need to know number of element in each index of list3 to define row and colomn. For column I think I can use list3.count; but for row I don't know how. After I know row. I have to put 0 to element in each index that have number of row less than row.
Pleas Help me. Thanks you.
List<List<string>>good for you?