Syntax:
nameof ( expression )
nameof (
)
Type:
string
Purpose:
returns the name of an expression as string.
Example:
int i=9; string s=nameof(i); s; → i nameof(s); → s nameof(i+1); //returns the empty string: → nameof(basering); → basering basering; → ? `basering` is undefined → ? error occurred in line 7: ` basering;` ring r; nameof(basering); → r
See names; reservedName; typeof.