Break

Switch Statements in C#

Introduction:

This tutorial is on how to use Switch statements in C#.

Switch:

A switch statement allows a single variable or static piece of data to be checked for mulitple conditions, essentially like a long 'else if' statement but a lot more compact and with slightly more flexability.

Case:

To use a switch statement there are a few other keywords we need to learn first, one of which is 'case'. Case is a possible value of the variable or value being 'switched', this must be of the same data type as the value being switched and must be followed by a colon. Break