using System.IO; var sw = new StringWriter(); sw.WriteLine("Hello, World!"); sw.WriteLine("This is a line of text."); var output = sw.ToString(); // output will be the complete string built by the StringWriterIn this example, `sw` is a new instance of the `StringWriter` class. We then call the `WriteLine` method twice to write two lines of text to the StringWriter. Finally, we retrieve the built string by calling the `ToString` method of the StringWriter instance. The `System.IO` namespace is part of the .NET Framework, which is a collection of libraries and runtime components for building and running applications on Windows.