Is there an inverse function to CharacterName? For example, CharacterName["ε"] gives "CurlyEpsilon". I'm looking for a function to do the reverse, given "CurlyEpsilon", output "ε". The best I could come up with was ToString[ToExpression[ "\[" <> # <> "]" ]]&, but I feel there must be a better way.
Asked
Active
Viewed 87 times
4
1 Answers
-2
Just put FullForm in front to go one way:
FullForm[ε]
(* \[Epsilon] *)
and \[Epsilon]
to go the other
(* ε *)
David G. Stork
- 41,180
- 3
- 34
- 96
-
2That's not what OP asks. The "better" way would be using
WolframLanguageDataor some kind ofEntityto extract the symbol from its name. – swish Feb 08 '17 at 22:21
ToExpression["\"\\[" <> # <> "]\""] &(eliminating theToString) – george2079 Feb 08 '17 at 21:57Symbol["\[" <> # <> "]"] &– Rolf Mertig Feb 08 '17 at 22:26System`Private`LookupCodeByName["CurlyEpsilon"] // FromCharacterCode. – WReach Feb 09 '17 at 00:14