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

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -