# Null formatter

> Output different text depending on whether a value is null.

Output different text depending on whether a value is null.

The Null formatter checks whether the placeholder value is null and outputs one of up to two formats. Apply it explicitly with the name `isnull`. It also treats a destroyed `UnityEngine.Object` as null.

The required first format of the Null formatter is used when the value is null. The optional second format is used otherwise. When only one format is provided, a non-null value outputs nothing. The second format can reuse the value with an empty placeholder `{}`.

Separate the formats with the split character. The default is `|`, but `,` and `~` are also valid.

| Smart String                     | Argument | Result    |
| -------------------------------- | -------- | --------- |
| `{0:isnull:It's null}`           | `null`   | It's null |
| `{0:isnull:It's null}`           | `"Lara"` | (empty)   |
| `{0:isnull:It's null\|Not null}` | `null`   | It's null |
| `{0:isnull:It's null\|Not null}` | `"Lara"` | Not null  |
| `{0:isnull:It's null\|{}}`       | `"Lara"` | Lara      |

## Additional resources

* [Choose formatter](/engine/6000.7/manual/scripting/smart-strings/formatters/choose-formatter.md)
* [Conditional formatter](/engine/6000.7/manual/scripting/smart-strings/formatters/conditional-formatter.md)
* [Smart Strings](/engine/6000.7/manual/scripting/smart-strings.md)
