C# 14 · Basics

Get a name as a string

Refer to variables and members without hard-coding their names.

ArgumentNullException.ThrowIfNull(user);
Console.WriteLine(nameof(user));

Official C# 14 documentation

More basics commands

All basics commands · C# 14 cheatsheet

Was this page helpful?