I'm fairly new with C# and having trouble converting some array types.
JavaScript code:
function toMatrix(list, elementsPerSubArray) {
var matrix = [], i, k;
for (i = 0, k = -1; i < list.length; i++) {
if (i % elementsPerSubArray === 0) {
k++;
matrix[k] = [];
}
matrix[k].push(list[i]);
}
return matrix;
}
I have tried converting the code but I struggle with the arrays in C#.
This may be easy to some, how would I do this?
Thanks.