I have two arrays.
let A = [\"91\",\"91\",\"49\"]
let B = [\"9989898909\",\"9089890890\",\"9098979896\"]
I need to merge these arrays and s
let A = ["91","91","49", "5"]
let B = ["9989898909","9089890890","9098979896"]
Use zip()
to join values from both arrays A
and B
. If A
and B
have a different number of elements, the joining would still work. then map
the tuples from the zipped result array to those elements with a space between them
let C : [String] = zip(A,B).map {$0 + " " + $1}