CSharp examples for Language Basics:Console
Read value from command line and check its value
using System;// www .j ava 2 s .co m class Program { static void Main(string[] args) { string result = ""; while (true) { Console.WriteLine("Type a word: "); string input = Console.ReadLine(); if (input == "") { break; } else { result += input + " "; } } Console.WriteLine("Result: {0}", result); } }