﻿---
title: csharp_space_before_open_square_brackets
description: Space before an opening square bracket. Defaults to `false`
url: https://docs-v3-preview.elastic.dev/reference/spacing/csharp_space_before_open_square_brackets
---

# csharp_space_before_open_square_brackets
Space before an opening square bracket.

## Values


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

**Default:** `false`

### `csharp_space_before_open_square_brackets = true`

```ini
csharp_space_before_open_square_brackets = true
```

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

    public class Widget
    {
        public int Get()
        {
            int[] arr = new int[10];
            arr[0] = 1;
            return arr[0];
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Get()
        {
            int [] arr = new int [10];
            arr [0] = 1;
            return arr [0];
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_before_open_square_brackets = false`

```ini
csharp_space_before_open_square_brackets = false
```

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

    public class Widget
    {
        public int Get()
        {
            int [] arr = new int [10];
            arr [0] = 1;
            return arr [0];
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Get()
        {
            int[] arr = new int[10];
            arr[0] = 1;
            return arr[0];
        }
    }
    ```
  </tab-item>
</tab-set>