WLJS LogoWLJS Notebook

StringToStream

StringToStream["string"] opens an input stream for reading from a string.

Examples

Create a stream from a string:

stream = StringToStream["Hello\nWorld"];
ReadLine[stream]
(* "Hello" *)
Close[stream]

Read all data:

stream = StringToStream["1 2 3"];
ReadList[stream, Number]
(* {1, 2, 3} *)
Close[stream]

Please visit the official Wolfram Language Reference for more details.

On this page