﻿---
title: csharp_wrap_chained_binary_expressions
description: Break each operand of a long && or || chain onto its own line. chop_always breaks regardless of width; wrap_if_long packs operands instead of breaking every one. Only honoured in deterministic mode (max_line_length set). Defaults to `(not set)`
url: https://docs-v3-preview.elastic.dev/reference/wrapping/csharp_wrap_chained_binary_expressions
---

# csharp_wrap_chained_binary_expressions
Break each operand of a long && or || chain onto its own line. chop_always breaks regardless of width; wrap_if_long packs operands instead of breaking every one. Only honoured in deterministic mode (max_line_length set).

## Values


| Value          | Notes |
|----------------|-------|
| `chop_always`  |       |
| `chop_if_long` |       |
| `wrap_if_long` |       |

**Default:** `(not set)`

### `csharp_wrap_chained_binary_expressions = chop_always`

```ini
csharp_wrap_chained_binary_expressions = chop_always
```

<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 && a + c > b && b + c > a;
        }
    }
    ```
  </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
                && a + c > b
                && b + c > a;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_wrap_chained_binary_expressions = chop_if_long`

```ini
csharp_wrap_chained_binary_expressions = chop_if_long
```

<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 && a + c > b && b + c > a;
        }
    }
    ```
  </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
                && a + c > b
                && b + c > a;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_wrap_chained_binary_expressions = wrap_if_long`

```ini
csharp_wrap_chained_binary_expressions = wrap_if_long
```

<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 && a + c > b && b + c > a;
        }
    }
    ```
  </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 && a + c > b
                && b + c > a;
        }
    }
    ```
  </tab-item>
</tab-set>