StringReader, StringBuilder, and StringWriter

This section talks about string I/O. This concept at first might sound strange—after all, we’ve been talking about file I/O until this point. But it is often very convenient to treat strings as files and write data to them just as you write data to a file.

This section covers three important classes: StringReader, StringBuilder, and StringWriter. The StringReader class implements a TextReader that reads from a string.

The StringBuilder class represents a custom constructor for strings and is used in conjunction with the String class to carry out modifications upon strings. It is convenient for situations in which it is desirable to modify a string, perhaps by removing, replacing, or inserting characters, ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.