﻿---
title: csharp_space_after_keywords_in_control_flow_statements
description: Space between a control-flow keyword and its opening parenthesis. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/spacing/csharp_space_after_keywords_in_control_flow_statements
---

# csharp_space_after_keywords_in_control_flow_statements
Space between a control-flow keyword and its opening parenthesis.

## Values


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

**Default:** `true`

### `csharp_space_after_keywords_in_control_flow_statements = true`

```ini
csharp_space_after_keywords_in_control_flow_statements = true
```

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

    public class Widget
    {
        public int Count(int n)
        {
            int total = 0;
            for(int i = 0; i < n; i++)
            {
                if(i % 2 == 0)
                    total++;
            }
            while(total > 100)
                total /= 2;
            return total;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Count(int n)
        {
            int total = 0;
            for (int i = 0; i < n; i++)
            {
                if (i % 2 == 0)
                    total++;
            }
            while (total > 100)
                total /= 2;
            return total;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_after_keywords_in_control_flow_statements = false`

```ini
csharp_space_after_keywords_in_control_flow_statements = false
```

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

    public class Widget
    {
        public int Count(int n)
        {
            int total = 0;
            for (int i = 0; i < n; i++)
            {
                if (i % 2 == 0)
                    total++;
            }
            while (total > 100)
                total /= 2;
            return total;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Count(int n)
        {
            int total = 0;
            for(int i = 0; i < n; i++)
            {
                if(i % 2 == 0)
                    total++;
            }
            while(total > 100)
                total /= 2;
            return total;
        }
    }
    ```
  </tab-item>
</tab-set>