我想在Julia中将整数转换为字符串。
当我尝试:
a = 9500
b = convert(String,a)
我遇到了这个错误:
ERROR: LoadError: MethodError: Cannot `convert` an object of type Int64 to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.
in include_from_node1(::String) at ./loading.jl:488
in process_options(::Base.JLOptions) at ./client.jl:265
in _start() at ./client.jl:321
while loading ..., in expression starting on line 16
我不确定为什么Int64不能转换为字符串。
我试过定义a
为不同的类型,例如a = UInt64(9500)
,但是收到了类似的错误信息。
我知道这很基础,并尝试在这里寻找正确的方法,但无法弄清楚。