CSharp examples for File IO:String Reader Writer
Create StringWriter from StringBuilder
using System;// w w w . j av a2 s. c om using System.IO; using System.Text; public class Program { public static void Main(string[] args) { string emily = "Hope is the thing with feathers\nThat perches in the soul...\n--Emily Dickinson"; StringBuilder builder = new StringBuilder(); StringWriter writer2 = new StringWriter(builder); foreach (string item in emily.Split(new char[] { '\n' })) { writer2.WriteLine(item); } } }