CSharp examples for Language Basics:Console
Read string value from console and add to StringBuilder
using System;//from w w w . j a v a 2 s . c o m using System.Text; class Program { static void Main(string[] args) { StringBuilder builder = new StringBuilder(); while (true) { Console.WriteLine("Type a word: "); string input = Console.ReadLine(); if (input == "") { break; } else { builder.Append(input + " "); } } Console.WriteLine("Result: {0}", builder.ToString()); } }