﻿---
title: csharp_space_between_parentheses
description: Space just inside parentheses for specific constructs. Defaults to `false`
url: https://docs-v3-preview.elastic.dev/reference/spacing/csharp_space_between_parentheses
---

# csharp_space_between_parentheses
Space just inside parentheses for specific constructs.

## Values


| Value                     | Notes |
|---------------------------|-------|
| `false`                   |       |
| `control_flow_statements` |       |
| `type_casts`              |       |
| `expressions`             |       |

**Default:** `false`

### `csharp_space_between_parentheses = false`

```ini
csharp_space_between_parentheses = false
```

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

    public class Widget
    {
        public string Classify(int n)
        {
            if ( n > 0 )
                return "positive";
            else if ( n < 0 )
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_between_parentheses = control_flow_statements`

```ini
csharp_space_between_parentheses = control_flow_statements
```

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public string Classify(int n)
        {
            if ( n > 0 )
                return "positive";
            else if ( n < 0 )
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_between_parentheses = type_casts`

```ini
csharp_space_between_parentheses = type_casts
```

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_between_parentheses = expressions`

```ini
csharp_space_between_parentheses = expressions
```

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public string Classify(int n)
        {
            if (n > 0)
                return "positive";
            else if (n < 0)
                return "negative";
            return "zero";
        }
    }
    ```
  </tab-item>
</tab-set>