Как хранить несколько разделенных значений в массиве
Hi, How to store multiple split up values in to array's or collection or some other things. For example, I have below table value. Student Marks Student1 Sub1 = A+B,Sub2=D+E,Sub3=F+G,etc my marks column values like "Sub1 = A+B,Sub2=D+E,Sub3=F+G,etc" I want to split All the subjects and store corresponding subject values in arrays. my out put should come as below. <pre>for example string[] words1 = student1.Split(','); so i can get below like [0]Sub1 = A+B [1]Sub2=D+E [2]Sub3=F+G for (int i = 0; i < words1.Length; i++) { string[] words2 = words1[i].Split('='); // Again splitting the values for Sub1 = A+B TempSub = words2[0]; // So Sub1 will be the variables } So the output array would be in the name of "Sub1","Sub2","Sub3",etc.. Sub1[0] = 90 Sub2[1] = 80 Sub3[2] = 90 pls. let me know if you need any more assist...
Что я уже пробовал:
string[] words1 = student1.Split(','); so i can get below like [0]Sub1 = A+B [1]Sub2=D+E [2]Sub3=F+G for (int i = 0; i < words1.Length; i++) { string[] words2 = words1[i].Split('='); // Again splitting the values for Sub1 = A+B TempSub = words2[0]; // So Sub1 will be the variables }