({{, (RefLink[StringToStream, paclet:ref/StringToStream])["string"]
opens an input stream for reading from a string. }})

OpenersNotesSection(Spacer1)Details

(RefLink[StringToStream, paclet:ref/StringToStream]) yields a stream of the form (RefLink[InputStream, paclet:ref/InputStream])[(RefLink[String, paclet:ref/String]),n].

Operations like (RefLink[Read, paclet:ref/Read]) and (RefLink[Find, paclet:ref/Find]) work on streams returned by (RefLink[StringToStream, paclet:ref/StringToStream]).

You must use (RefLink[Close, paclet:ref/Close]) to close streams created by (RefLink[StringToStream, paclet:ref/StringToStream]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Convert a string to a stream:

str=StringToStream["234,32412,4234"]

Read the first number from the stream object:

Read[str,Number]

Read the next character from the stream:

Read[str,Character]

Close the stream:

Close[str]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Characters, paclet:ref/Characters])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Searching and Reading Strings, paclet:tutorial/SearchingAndReadingStrings])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[String Operations, paclet:guide/StringOperations])}, {▪(RefLinkPlain[Low-Level File Operations, paclet:guide/LowLevelFileOperations])}})}})