Like @mz, with an understanding like this,
for ( (a,b) <- x zip y ) yield a + b
It can be encapsulated in implicit, such as
implicit class StrArrayOps(val x: Array[String]) extends AnyVal {
def join(y: Array[String]) =
for ( (a,b) <- x zip y ) yield a + b
}
and use it like this:
x join y
Array(one1, two2, three3)
source
share