Julia convert symbol to string

Viewed 2462

How do I convert a symbol to a string in Julia? The following don't work:

String(:A)
convert(String,:A)

They did work in Julia version 0.4.

1 Answers

You could use the string function:

julia> string(:A)
"A"

However as of Julia 1.5.1 String(symb) also seems to work:

julia> String(:A)
"A"

However String(:A) is the recommended method as it just directly creates the String object from Symbol and hence is 3x faster.

Related