1

Why am I getting the error

Syntax::sntunc: Unicode longname in the string is unterminated.

from the following?

astroSymbol[name_String] := ToString[ToExpression["\[" <> name <> "]"]] <> "" ;

Is there something I need to do to wrap the escape sequence to avoid this error?

orome
  • 12,819
  • 3
  • 52
  • 100

1 Answers1

4

To include a backslash in a string, you need to escape it, like so:

"\\[" <> name <> "]"
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263