﻿---
title: csharp_space_around_binary_operators
description: Spaces around binary and assignment operators. Defaults to `before_and_after`
url: https://docs-v3-preview.elastic.dev/reference/spacing/csharp_space_around_binary_operators
---

# csharp_space_around_binary_operators
Spaces around binary and assignment operators.

## Values


| Value              | Notes |
|--------------------|-------|
| `before_and_after` |       |
| `none`             |       |
| `ignore`           |       |

**Default:** `before_and_after`

### `csharp_space_around_binary_operators = before_and_after`

```ini
csharp_space_around_binary_operators = before_and_after
```

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a>0&&b>0&&c>0&&a+b>c;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a > 0 && b > 0 && c > 0 && a + b > c;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_around_binary_operators = none`

```ini
csharp_space_around_binary_operators = none
```

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a > 0 && b > 0 && c > 0 && a + b > c;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a>0&&b>0&&c>0&&a+b>c;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_around_binary_operators = ignore`

```ini
csharp_space_around_binary_operators = ignore
```

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a > 0 && b > 0 && c > 0 && a + b > c;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public bool Check(int a, int b, int c)
        {
            return a>0&&b>0&&c>0&&a+b>c;
        }
    }
    ```
  </tab-item>
</tab-set>