Answers for "can you have multiple return types in c#"

C#
10

c# return two variables of different types

(string, string, int) LookupName(long id) // tuple return type
{
    ... // retrieve first, middle and myNum from data storage
    return (first, middle, myNum); // tuple literal
}
Posted by: Guest on March-20-2020
1

c# method returns multiple values

public Tuple<int, int> GetMultipleValue()
{
     return Tuple.Create(1,2);
}
Posted by: Guest on September-30-2020

Code answers related to "can you have multiple return types in c#"

C# Answers by Framework

Browse Popular Code Answers by Language