Version: Unity 6.7 Alpha (6000.7)
Language : English
List formatter
Plural formatter

Null formatter

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

List formatter
Plural formatter