Printing a parameter name

Download c# eBook

Example

Snippet

public void DoSomething(int paramValue)
{
    Console.WriteLine(nameof(paramValue));
}

...

int myValue = 10;
DoSomething(myValue);

Console Output

paramValue

Stats

Contributors: 1
2015-12-17
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook