January 2003
Intermediate to advanced
896 pages
19h 58m
English
These classes allow you to read and write strings in memory. The StringReader and StringWriter classes derive from the TextReader and TextWriter abstract classes, which provide functionality for reading and writing characters rather than bytes. The StringReader has only one constructor, which takes a string parameter. Then you can use the StringReader to perform read operations on the string as if it were any other type of stream object, such as a FileStream object.
The following example creates a string and a StringReader object you use to read the string. It uses the ReadLine method to read the string one line at a time. The StringReader class also supports other read methods (Read, ReadBlock ...
Read now
Unlock full access