有没有一种方法可以在Julia中将整数数组(或任何数字)转换为字符串数组?实际上,我想将[1 2 3 4]
转换为["1" "2" "3" "4"]
。
无效的内容:
numbers = [1 2 3 4];
strings = ["1" "2" "3" "4"];
string(numbers)
convert(Array{String}, numbers)
输出:
"[1 2 3 4]"
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String
...
我正在使用 Julia 1.3.1 版本。