How to convert input expression to FullForm String
You just put Unevaluated
in the wrong spot:
SetAttributes[fullFormString, HoldAll];
fullFormString[expr_] := ToString[Unevaluated @ FullForm[expr]]
For your example:
fullFormString[Integrate[\[Alpha]^2, {\[Alpha], -3, 3}]]
"Integrate[Power[\[Alpha], 2], List[\[Alpha], -3, 3]]"
Maybe this way?
SetAttributes[fullFormString, HoldAll];
fullFormString[expr_] := ToString[HoldForm[FullForm[expr]], OutputForm]
Or maybe this way?
SetAttributes[fullFormString, HoldAll];
fullFormString[expr_] :=
StringReplace[
ToString[FullForm[Unevaluated[expr]], OutputForm],
"Unevaluated[" ~~ Longest[u__] ~~ "]" -> u]
fullFormString[Integrate[α^2, {α, -3, 3}]]
"Integrate[Power[\\[Alpha], 2], List[\\[Alpha], -3, 3]]"