I have string similar to this
string text = "3;4;5;6;7;;3;4;5;6;7;;3;4;5;6;7;;3;4;5;6;7;;3;4;5;6;7;;";
I want to convert the above string into an int array like
[[3,4,5,6,7],[3,4,5,6,7], [3,4,5,6,7], [3,4,5,6,7], [3,4,5,6,7]]
I want to do this so that I can access each number because I want to do some maths like (3+4)/2 and (5+6)/2 for each set of array.
Until now I am using a simple split method:
string[] columns = text.Split(';');
and printing it by using:
foreach (var item in columns)
{
Console.WriteLine($"{item}");
}
But this has not worked and I am getting one number after another each indicating separate item.
I want [3,4,5,6,7] as one item and 5 items inside this particular item and in integer form.
Can you help me with how to do this?