Mathematica 9 is now available
 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]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.