This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / String Manipulation  /
StringToStream

  • StringToStream[" string "] opens an input stream for reading from a string.
  • StringToStream yields a stream of the form InputStream[String, n ].
  • Operations like Read and Find work on streams returned by StringToStream.
  • You must use Close to close streams created by StringToStream.
  • See the Mathematica book: Section 2.11.9.
  • See also: Characters.

    Further Examples

    This converts a string to an input stream object.

    In[1]:=

    Out[1]=

    This reads the first number from the stream object.

    In[2]:=

    Out[2]=

    This reads the remaining numbers from the stream object.

    In[3]:=

    Out[3]=

    This closes the stream.

    In[4]:=

    Out[4]=