nameof Operator

suggest change

Introduction

The nameof operator allows you to get the name of a variable, type or member in string form without hard-coding it as a literal.

The operation is evaluated at compile-time, which means that you can rename a referenced identifier, using an IDE’s rename feature, and the name string will update with it.

Syntax

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents