0

Ok so does any body have any ideas or hints on how to select a range of values from an array???

say: Array1[1,0] to Array1[10,0]

so that would be the first values in each row from 1 to 10.

ANy ideas?

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Mark_48
0

Here you have an example code of multipidimensional array, and how to get values out of it:

int[,] array = new int[3, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } };
            int[] newNumbers = null;
            for (int i = 0; i < array.GetLength(1); i++)
            {
                for (int j = 0; j < array.GetLength(0); j++)
                {
                    Array.Resize(ref newNumbers, (j + 1));
                    newNumbers[j] = array[j, i];
                }
                break;
            }
0

The "newNumbers" will be: 1,5 and 9.
I think this is what you have been looking for.

thank you!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.