【发布时间】:2020-05-16 15:59:38
【问题描述】:
有没有办法在 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
...
我使用的是 Juila 1.3.1
【问题讨论】:
标签: arrays type-conversion julia