Possible Duplicate:
Switch statement fallthrough in C#?
The following code is illegal in C# because control cannot fall through from one case label to another. However, this behaviour is perfectly legal in C++. So, how would you go about coding the same behaviour in C#?
enum TotalWords
{
One = 1,
Two,
Three,
Four
}
public String SomeMethod(TotalWords totalWords)
{
String phrase = "";
switch (totalWords)
{
case TotalWords.Four:
phrase = "Fox" + phrase;
case TotalWords.Three:
phrase = "Brown" + phrase;
case TotalWords.Two:
phrase = "Quick" + phrase;
case TotalWords.One:
phrase = "The" + phrase;
break;
default:
break;
}
return phrase;
}