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
Post a Comment