# Null-Forgiving Operator

*noun*

say it: **“NUL fer-GIV-ing OP-er-ay-ter”** **/nʌl fərˈɡɪvɪŋ ˈɒpəreɪtər/**

A ! after a value that tells the C# compiler you are sure it is not null.

## What is **Null-Forgiving Operator** in C#?

**Null-Forgiving Operator** — A `!` after a value that tells the compiler "I know this isn't null", which silences its warning. It changes nothing when the program runs, so if you're wrong you still get a `NullReferenceException`.

```csharp
string? title = Console.ReadLine();   // the compiler warns: may be null
int length = title!.Length;           // you promise it isn't
```

## In a sentence

- “I added the **null-forgiving operator** after ReadLine() because the input here is never empty.”

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=3)

Updated: October 28, 2026

Source: https://www.ask-codey.com/glossary/null-forgiving-operator
