StringToStream["string"]
opens an input stream for reading from a string.
StringToStream
StringToStream["string"]
opens an input stream for reading from a string.
Details
- 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.
Examples
open all close allBasic Examples (1)
Possible Issues (1)
If a string contains special characters, the Byte format can return values greater than 255:
string = "aαℵ";stream = StringToStream[string]
ReadList[stream, Byte]These correspond to the individual character codes:
ToCharacterCode[string]Close[stream]See Also
Tech Notes
Related Guides
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), StringToStream, Wolfram Language function, https://reference.wolfram.com/language/ref/StringToStream.html.
CMS
Wolfram Language. 1991. "StringToStream." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StringToStream.html.
APA
Wolfram Language. (1991). StringToStream. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringToStream.html
BibTeX
@misc{reference.wolfram_2026_stringtostream, author="Wolfram Research", title="{StringToStream}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/StringToStream.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_stringtostream, organization={Wolfram Research}, title={StringToStream}, year={1991}, url={https://reference.wolfram.com/language/ref/StringToStream.html}, note=[Accessed: 15-June-2026]}