c# - How to get the value of a two dimensional array in Razor? -


i have jagged array shown below, , array inside c# code:

@{     int[][] array = new int[2][4];     // codes here manipulates values of array. } 

now want get/traverse values in array. code below don't work. when run program got run-time error "index outside bounds of array."

for(var = 0 ; < @array.count(); i++){     alert( '@array['i'].length'); } 

how that?

thanks

try like

foreach(var subarray in array) {    @:alert(subarray.length); } 

but wont length same since statically declared?


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -