Thursday, 22 August 2013

can optional parameter be put before params of same type in C#

can optional parameter be put before params of same type in C#

In other words: Is this possible?
public void ShowMessage(string cultureKeyText, string cultureKeyTitle =
null, params string[] fields)
when using comma separated list to call it. How would it know if 2nd
parameter is actually 2nd parameter or 1st in comma separated list of 3rd
parameter?

No comments:

Post a Comment