Wednesday, 15 December 2010

C# Switch


// switch with string type
switch (myInput)
{
case "continue":
Console.WriteLine("Hello");
break;
case "quit":
Console.WriteLine(
"Bye.");
break;
default:
Console.WriteLine(
"Your input {0} is incorrect.", myInput);
break;
}