Scala: Array[Array[Int]] to Array[Int] -


so have array of array of ints, example

val n = array(array(1,2,3), array(4,5,6), array(7,8,9))

but want convert array(1,2,3,4,5,6,7,8,9)

is possible , how? thanks!

you can use flatten method. calling n.flatten output array(1,2,3,4,5,6,7,8,9).


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -