I have a python script:
def f():
a = None
b = None
return (a, b)
a, b = f()
It’s so easy to achieve multiple return values in python.
And now I want to achieve the same result in C#. I tried several ways, like return int[] or KeyValuePair. But both ways looked not elegant. I wonder a exciting solution. thanks a lot.
Unfortunately, C# does not support this. The closest you can get is to use
outparameters: