I am currently receiving data from a client computer in the form of a string but I want it as a 2D array which is [25,3]. So I split it off into a single array first then tried to split that single array into a 2D array. However when I run the code I keep seeing an empty array anyone know why?
private void ClientReceiveData(object sender, ConnectedClient.NetDataEventArgs e)
{
if (string.IsNullOrEmpty(e.Message) == false)
{
if (e.ID == 0)
{
result = Array.ConvertAll(e.Message.Split(new[] { ',', }, StringSplitOptions.RemoveEmptyEntries), Double.Parse);
for (int i = 0; i < result.Length; i++)
{
resultarray2D[i % 3, i % 3] = result[i];
Trace.WriteLine(resultarray2D);
}
}
if (e.ID == 1)
{
answer = Array.ConvertAll(e.Message.Split(new[] { ',', }, StringSplitOptions.RemoveEmptyEntries), Double.Parse);
for (int i = 0; i < answer.Length; i++)
{
answerarray2D[i % 3, i / 3] = answer[i];
Trace.WriteLine(answerarray2D);
}
}

.ToString()on an array outputs. If you want to see the contents of an array you have to access the individual values by indexConvertAlldoes not work with multi-dimentions. Give us a single line of input, so we can judge what you're doing. And why do you usemodthere?