StringToStream
✖
StringToStream
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 allclose allBasic Examples (1)Summary of the most common use cases
In[1]:=1
✖
https://wolfram.com/xid/0b0jxaiykyu-2kttpj
Out[1]=1
Read the first number from the stream object:
In[2]:=2
✖
https://wolfram.com/xid/0b0jxaiykyu-24rspv
Out[2]=2
Read the next character from the stream:
In[3]:=3
✖
https://wolfram.com/xid/0b0jxaiykyu-cjdwfg
Out[3]=3
In[4]:=4
✖
https://wolfram.com/xid/0b0jxaiykyu-mnair2
Out[4]=4
Possible Issues (1)Common pitfalls and unexpected behavior
If a string contains special characters, the Byte format can return values greater than 255:
In[1]:=1
✖
https://wolfram.com/xid/0b0jxaiykyu-cgrhas
In[2]:=2
✖
https://wolfram.com/xid/0b0jxaiykyu-1nno92
Out[2]=2
Out[3]=3
These correspond to the individual character codes:
In[4]:=4
✖
https://wolfram.com/xid/0b0jxaiykyu-job4ip
Out[4]=4
In[5]:=5
✖
https://wolfram.com/xid/0b0jxaiykyu-5v5q5o
Out[5]=5
Wolfram Research (1991), StringToStream, Wolfram Language function, https://reference.wolfram.com/language/ref/StringToStream.html.
✖
Wolfram Research (1991), StringToStream, Wolfram Language function, https://reference.wolfram.com/language/ref/StringToStream.html.
Text
Wolfram Research (1991), StringToStream, Wolfram Language function, https://reference.wolfram.com/language/ref/StringToStream.html.
✖
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.
✖
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
✖
Wolfram Language. (1991). StringToStream. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringToStream.html
BibTeX
✖
@misc{reference.wolfram_2024_stringtostream, author="Wolfram Research", title="{StringToStream}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/StringToStream.html}", note=[Accessed: 10-January-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2024_stringtostream, organization={Wolfram Research}, title={StringToStream}, year={1991}, url={https://reference.wolfram.com/language/ref/StringToStream.html}, note=[Accessed: 10-January-2025
]}