配列から文字列、文字列から配列への変換 (convert array to string, string to array)
配列を文字列に変換
join
を使う:
a = ["a","b","c","d","e"] join(a, " - ", " and ")
"a - b - c - d and e"
join
のオプションを2つ指定すると、最後の区切りだけ2つ目のものになる。- 3つ以上はたぶん指定不可。
文字列を配列に変換
split
を使う:
a = "a b c d e" u = split(a, " ")
5-element Array{SubString{ASCIIString},1}:
"a"
"b"
"c"
"d"
"e"