Creates a switch statement

    0

    10

    lucycodes42

    C# recipes

    This code will execute the code inside the case statement if the value is equal to value1, and it will break out of the switch statement if any other value is input.

    Shortcut: switch

    switch (value)
    {
      case value1:
        break;
      default:
        break;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.