4
Reply

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

behzad pakniyat

behzad pakniyat

Jun 22 2015 11:20 AM
509
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)
Next Recommended Forum