Is there a function in Julia that behaves like a R paste() function? In particular, if we give the function two vectors, it will return one vector with the elementary concatenation of two input vectors.
I looked around and can not find the answer for this in the docs or otherwise. An older article by John Miles White suggests that the Julia join() function is the closest analogue, but it seems to work only on pairs of strings, not elementary on row vectors.
Currently, I just use the function below, which iterates over the elements that call join() , but I wonder if there is a better approach.
x = ["aa", "bb", "cc"] y = ["dd", "ee", "ff"] function mypaste(v1, v2) n = length(v1) res = Array{ASCIIString}(n) for i = 1:n res[i] = join([v1[i], v2[i]]) end return res end mypaste(x, y)
Running mypaste() gives us the result below if required.
3-element Array{ASCIIString,1}: "aadd" "bbee" "ccff"
Is there a good alternative? Do I really not understand the join() function?
source share