Argument order is not necessary C# with Example



Argument order is not necessary C# with Example

You can place named arguments in any order you want. 
Sample Method: 
public static string Sample(string left, string right) 
{ 
return string.Join("-",left,right); 
} 
Call Sample: 
Console.WriteLine (Sample(left:"A",right:"B")); 
Console.WriteLine (Sample(right:"A",left:"B")); 
Results: 
A-B 
B-A 

0 Comment's

Comment Form

Submit Comment