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

# csharp_new_line_before_finally
Put finally on its own line.

## Values


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

**Default:** `true`

### `csharp_new_line_before_finally = true`

```ini
csharp_new_line_before_finally = 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;
            } finally {
                Console.WriteLine("done");
            }
        }
    }
    ```
  </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;
            }
            finally
            {
                Console.WriteLine("done");
            }
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_new_line_before_finally = false`

```ini
csharp_new_line_before_finally = 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;
            }
            finally
            {
                Console.WriteLine("done");
            }
        }
    }
    ```
  </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;
            } finally
            {
                Console.WriteLine("done");
            }
        }
    }
    ```
  </tab-item>
</tab-set>