Using C#, we can easily convert ValueTuple to Tuple using ToTuple() method.
Note - Add the System.ValueTuple package to run the ValueTuple program.
>Let's see how to add it -
using System; class Program { static void Main() { var val = (5, 50, 500, 5000); //Add System.ValueTuple package to run this program // ValueTuple Console.WriteLine(“ValueTuple: ” val); // Tuple Tuple<int, int, int, int> myTuple = val.ToTuple(); Console.WriteLine(“Tuple: ”+myTuple); } }
ValueTuple: (5, 50, 500, 5000) Tuple: (5, 50, 500, 5000)
The above is the detailed content of Convert ValueTuple to Tuple in C#. For more information, please follow other related articles on the PHP Chinese website!