C# 14 · Basics

Assign only when null

Assign a default if a variable is currently null.

cache ??= new Dictionary<string, int>();

Official C# 14 documentation

More basics commands

All basics commands · C# 14 cheatsheet

Was this page helpful?