CSharp examples for Language Basics:Console
Using ReadLine to Read Characters
using System;/*from w ww . j a v a 2 s. c om*/ using System.Text; class ReadLine { public static void Main() { StringBuilder Input = new StringBuilder(); string buff; Console.WriteLine("Enter text. When done, press Ctrl+Z:"); while ( (buff = Console.ReadLine()) != null ) { Input.Append(buff); Input.Append("\n"); } Console.Write( Input ); } }