﻿---
title: csharp_new_line_before_catch
description: Put catch on its own line. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/new-lines/csharp_new_line_before_catch
---

# csharp_new_line_before_catch
Put catch on its own line.

## Values


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

**Default:** `true`

### `csharp_new_line_before_catch = true`

```ini
csharp_new_line_before_catch = true
```

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

    public class Widget
    {
        public int Parse(string s)
        {
            try {
                return int.Parse(s);
            } catch (FormatException) {
                return 0;
            }
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Parse(string s)
        {
            try
            {
                return int.Parse(s);
            }
            catch (FormatException)
            {
                return 0;
            }
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_new_line_before_catch = false`

```ini
csharp_new_line_before_catch = false
```

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

    public class Widget
    {
        public int Parse(string s)
        {
            try
            {
                return int.Parse(s);
            }
            catch (FormatException)
            {
                return 0;
            }
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Parse(string s)
        {
            try
            {
                return int.Parse(s);
            } catch (FormatException)
            {
                return 0;
            }
        }
    }
    ```
  </tab-item>
</tab-set>