Consider the following example method:
public void MyMethod (string par1, bool par2 = "true", string par3="")
{
}
Now let's say that I call MyMethod and set the par3 value to "IamString".
How can I do this without setting par2 to true or false?
Basically I want to leave par2 as default.
I ask this because in Flash ActionScript this can be done using the default keyword so that I can call MyMethod ("somestring", default, "IamString") and par2 will be interpreted as true, which is its default value. I wonder if this is also possible in C #.
source
share