I entered the following code into the Input cell. And the code expressed as RowBox was obtained using the Show Expression menu.
I want to get a Plain Text in the form of InputForm again from this code.
expr = Cell[BoxData[RowBox[{"Plot", "[",
RowBox[{RowBox[{RowBox[{"Sin", "[", SuperscriptBox["x", "2"], "]"}], "+",
SqrtBox[FractionBox["x", "2"]]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}],
"}"}]}], "]"}]], "Input"]
How do I write code to get Plain Text in InputForm format? The text I want to get is as follows.
In[1]:= text = ... Code using 'expr' ...
Out[1]= Plot[Sin[x^2] + Sqrt[x/2], {x, 0, 3}]
I will continue my next work using the results obtained like this (=text).

First[FrontEndExecute[FrontEnd\ExportPacket[First@NotebookRead[PreviousCell[]], "PlainText"]]]` – Kuba Nov 13 '23 at 07:36https://mathematica.stackexchange.com/questions/292526/
– Milk Nov 13 '23 at 07:43ToExpression[expr[[1,1]], StandardForm, Defer]– Carl Woll Nov 13 '23 at 22:14