When I write ToString[a->b]
, regardless of whether the input uses the right-arrow symbol or -
and >
separately, it comes out as "a -> b"
with -
and >
. If I just write "->"
but with the right-arrow symbol, that's what I get in the output, so it's possible to get the arrow to show up in a string, but is there a good way to do this without having to break up the expression before using ToString
?
$\begingroup$
$\endgroup$
2
1 Answer
$\begingroup$
$\endgroup$
ToString[a -> b, StandardForm]
give what you want? $\endgroup$