﻿---
title: csharp_indent_switch_labels
description: Indent case labels inside their switch. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/indentation/csharp_indent_switch_labels
---

# csharp_indent_switch_labels
Indent case labels inside their switch.

## Values


| Value   | Notes |
|---------|-------|
| `true`  |       |
| `false` |       |

**Default:** `true`

### `csharp_indent_switch_labels = true`

```ini
csharp_indent_switch_labels = true
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        public string Name(int code)
        {
            switch (code)
            {
            case 1:
                return "one";
            case 2:
            {
                var msg = "two";
                return msg;
            }
            default:
                return "other";
            }
        }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        public string Name(int code)
        {
            switch (code)
            {
                case 1:
                    return "one";
                case 2:
                    {
                        var msg = "two";
                        return msg;
                    }
                default:
                    return "other";
            }
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_indent_switch_labels = false`

```ini
csharp_indent_switch_labels = false
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        public string Name(int code)
        {
            switch (code)
            {
                case 1:
                    return "one";
                case 2:
                    {
                        var msg = "two";
                        return msg;
                    }
                default:
                    return "other";
            }
        }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        public string Name(int code)
        {
            switch (code)
            {
            case 1:
                return "one";
            case 2:
                {
                    var msg = "two";
                    return msg;
                }
            default:
                return "other";
            }
        }
    }
    ```
  </tab-item>
</tab-set>