expr = First@
Level[Values@
WolframLanguageData["Plot",
EntityProperty["WolframLanguageSymbol",
"DocumentationExampleInputs"]], {3}]
Plot[Sin[x], {x, 0, 6 Pi}]
But I find the Head
of expr
is RawBoxes
Head@expr
(* RawBoxes *)
And I cannot get the string like "Plot[Sin[x],{x,0,6 Pi}]"
ToString@expr
(* "RawBoxes[Cell[BoxData[RowBox[{Plot, [, RowBox[{RowBox[{Sin,
[, x, ]}], ,, RowBox[{{, RowBox[{x, ,, 0, ,, RowBox[{6, Pi}]}],
}}]}], ]}]], Input, ShowStringCharacters -> True]]" *)
MakeExpression
orToExpression
? $\endgroup$