behzad pakniyat

behzad pakniyat

  • 1.5k
  • 102
  • 10.2k

can not the "string.Empty" as the default parameter method?

Jun 22 2015 11:20 AM
Hi
To all users
When the value of "string.Empty" parameter method I use, I encountered the following error:
 
Error 1 Default parameter value for 'Name' must be a compile-time constant.
 
public void SetName(string Name = string.Empty)
{
   this.mName = Name;
}
 
 
thanks.

Answers (4)