scala - Operation inside tuple - Convert a nested array into flat array -


i asked question how convert array("aa", array("bb", "cc"), "dd") array("aa", "bb", "cc", "dd"), solved by

arr.flatmap {    |   case s: string => array(s)    |   case a: array[string] =>    | }  

now have data array((aa, array(bb, cc), dd)). looks array of tuple contains nested array. want output array((aa, bb, cc, dd)), couldn't figure out. please help! thanks!

you can this:

val = arr.head; array(a._1, a._2, a._3)... [the rest of code] 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -