Tuple solution C# with Example



Tuple solution C# with Example

You can return an instance of Tuple class from your function with two template parameters as Tuple: 
public Tuple FunctionWith2ReturnValues () 
{ 
return Tuple.Create("abc", new MyClass()); 
} 
And read the values like below: 
Console.WriteLine(x.Item1); 
Console.WriteLine(x.Item2); 

0 Comment's

Comment Form

Submit Comment