﻿---
title: csharp_space_after_cast
description: Space between a cast and its operand. Defaults to `false`
url: https://docs-v3-preview.elastic.dev/reference/spacing/csharp_space_after_cast
---

# csharp_space_after_cast
Space between a cast and its operand.

## Values


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

**Default:** `false`

### `csharp_space_after_cast = true`

```ini
csharp_space_after_cast = true
```

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

    public class Widget
    {
        public int Narrow(object o, double d)
        {
            int x = (int)o;
            float y = (float)d;
            return x + (int)y;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Narrow(object o, double d)
        {
            int x = (int) o;
            float y = (float) d;
            return x + (int) y;
        }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_space_after_cast = false`

```ini
csharp_space_after_cast = false
```

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

    public class Widget
    {
        public int Narrow(object o, double d)
        {
            int x = (int) o;
            float y = (float) d;
            return x + (int) y;
        }
    }
    ```
  </tab-item>

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

    public class Widget
    {
        public int Narrow(object o, double d)
        {
            int x = (int)o;
            float y = (float)d;
            return x + (int)y;
        }
    }
    ```
  </tab-item>
</tab-set>