WOLFRAM

StringToStream["string"]

opens an input stream for reading from a string.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Convert a string to a stream:

Out[1]=1

Read the first number from the stream object:

Out[2]=2

Read the next character from the stream:

Out[3]=3

Close the stream:

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:

Out[2]=2
Out[3]=3

These correspond to the individual character codes:

Out[4]=4

Close the stream:

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 ]}

@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 ]}

@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 ]}