How to convert Array Any to String?


#1

How to convert Array Any to String ?

julia> x=[1,2,3,“a”]
4-element Array{Any,1}:
1
2
3
"a"

julia> convert(Array{String},x)
ERROR: 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 copy!(::Base.LinearFast, ::Array{String,1}, ::Base.LinearFast, ::Array{Any,1}) at .\abstractarray.jl:559
in convert(::Type{Array{String,N}}, ::Array{Any,1}) at .\array.jl:235
Paul


#2
julia> x=[1,2,3,"a"]
4-element Array{Any,1}:
 1   
 2   
 3   
  "a"

julia> string.(x)
4-element Array{String,1}:
 "1"
 "2"
 "3"
 "a"