«^»
7.2. switch statement

C#'s switch statement has two ‘improvements’ over that of Java's:

  1. It is not possible to fall through from one arm to the next. So:

    case 0:
        i = 1;
    case 1:
        j = 2;
    

    is illegal. An arm must end in a statement that transfers control. Four examples of such statements are:

    break;
    goto case 1;
    goto default;
    return;
    

  2. A string may be used as a selector:
    switch ( tCommand )
    {
        case "add":
            ...
            break;
        case "remove":
            ...
            break;
    }