﻿---
title: trim_trailing_whitespace
description: Remove trailing whitespace from each line. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/core/trim_trailing_whitespace
---

# trim_trailing_whitespace
Remove trailing whitespace from each line.

## Values


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

**Default:** `true`

### `trim_trailing_whitespace = true`

```ini
trim_trailing_whitespace = true
```

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

    public class Widget
    {
        public int Value { get; set; }

        public int Double()
        {
            return Value * 2;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Value { get; set; }

        public int Double()
        {
            return Value * 2;
        }
    }
    ```
  </tab-item>
</tab-set>


### `trim_trailing_whitespace = false`

```ini
trim_trailing_whitespace = false
```

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

    public class Widget
    {
        public int Value { get; set; }

        public int Double()
        {
            return Value * 2;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Value { get; set; }

        public int Double()
        {
            return Value * 2;
        }
    }
    ```
  </tab-item>
</tab-set>