How to declare a string array for the purpose of concatenation

The undef isn’t really relevant here. The point is that you’re doing string(str, ...), where str is an array of strings (initially with one element).

string(["abc"]) gives ["abc"], which just isn’t what you want here.

If you want the easy answer, the way to join strings is…join() :slightly_smiling_face:

julia> str1 = ["abc", "def", "ghi"]
3-element Vector{String}:
 "abc"
 "def"
 "ghi"

julia> join(str1)
"abcdefghi"
5 Likes