Is there a way to convert an input expression to FullForm String?
Here is my attempt, which is almost there.
SetAttributes[fullFormString, HoldAll];
fullFormString[expr_] := ToString[FullForm[Unevaluated[expr]], OutputForm]
But Unevaluated
appears in the string, which I don't want.
fullFormString[Integrate[α^2, {α, -3, 3}]]
"Unevaluated[Integrate[Power[\\[Alpha], 2], List[\\[Alpha], -3, 3]]]"
The escaped \
is correct. I just need the canonical way to make a FullForm
string without the Unevaluated
.
StringReplace
, but is there a better way? $\endgroup$