﻿---
title: csharp_indent_case_contents
description: Indent statements inside a case label. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/indentation/csharp_indent_case_contents
---

# csharp_indent_case_contents
Indent statements inside a case label.

## Values


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

**Default:** `true`

### `csharp_indent_case_contents = true`

```ini
csharp_indent_case_contents = 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_case_contents = false`

```ini
csharp_indent_case_contents = 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>