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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -