This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

InString

InString[n]
is a global object that is assigned to be the text of the n^(th) input line.
  • InString[n] gives the string that Mathematica read for the n^(th) input line. The string includes all intermediate newlines in the input, but not the newline at the end.
  • The value of InString[n] is assigned after the input is verified to be syntactically correct, and after any function given as the value of $PreRead has been applied.
  • InString gives the text of the last input line.
  • InString gives the text of the input k lines back.
Show input as a string:
With StandardForm input, the string represents a typeset expression:
Show input as a string:
In[1]:=
Click for copyable input
Out[1]=
With StandardForm input, the string represents a typeset expression:
In[2]:=
Click for copyable input
Out[2]=
New in 2