How to create 2-ValueTuple in C#? Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In C#, a pair or 2 value tuple is a value type tuple which holds two elements in it. You can create a pair of value tuple using two different ways: Using ValueTuple <T1, T2>(T1, T2) Constructor Using Create <T1, T2>(T1, T2) Method Using ValueTuple <T1, T2>(T1, T2) Constructor You can create a pair value tuple by using ValueTuple <T1, T2>(T1, T2) constructor. It initializes a new instance of the ValueTuple <T1, T2> struct. But when you create a value tuple using this constructor, then you have to specify the type of the element stored in the value tuple. Syntax: public ValueTuple (T1 item1, T2 item2); Parameters: item1: It is the value of the first value tuple component. item2: It is the value of the second value tuple component. Example: CSharp // C# program to create a pair ValueTuple // using value tuple constructor using System; class GFG { // Main method static public void Main() { // Creating a value tuple with two elements // Using ValueTuple<T1, T2>(T1, T2) constructor ValueTuple<string, string> MyTpl = new ValueTuple<string, string>("Geeks", "GFG"); Console.WriteLine("Component 1: " + MyTpl.Item1); Console.WriteLine("Component 2: " + MyTpl.Item2); } } Output: Component 1: Geeks Component 2: GFG Using Create <T1, T2>(T1, T2) Method You can also create a pair value tuple with the help of Create <T1, T2>(T1, T2) method. When you use this method, then there is no need to specify the type of the elements stored in the value tuple. Syntax: public static ValueTuple<T1, T2> Create<T1, T2> (T1 item1, T2 item2); Type Parameters: T1: It is the type of the value tuple's first component. T2: It is the type of the value tuple's second component. Parameters: item1: It is the value of the value tuple's first component. item2: It is the value of the value tuple's second component. Returns: This method returns a value tuple with two elements. Example: CSharp // C# program to create a pair value tuple // using Create<T1, T2>(T1, T2) method using System; public class GFG { // Main method static public void Main() { // Creating a value tuple with two elements // Using Create<T1, T2>(T1, T2) method var MyTple = ValueTuple.Create("Geeks123", "gfg"); Console.WriteLine("Component 1: " + MyTple.Item1); Console.WriteLine("Component 2: " + MyTple.Item2); } } Output: Component 1: Geeks123 Component 2: gfg Reference: https://learn.microsoft.com/en-us/dotnet/api/system.valuetuple-2.-ctor?view=netframework-4.8 https://learn.microsoft.com/en-us/dotnet/api/system.valuetuple.create?view=netframework-4.8#System_ValueTuple_Create__2___0___1_ Comment More infoAdvertise with us Next Article How to create 5-ValueTuple in C#? A ankita_saini Follow Improve Article Tags : C# CSharp-ValueTuple Similar Reads How to create 4-ValueTuple in C#? In C#, a quadruple or 4 value tuple is a value type tuple which holds four elements in it. You can create a quadruple value tuple using two different ways: Using ValueTuple <T1, T2, T3, T4>(T1, T2, T3, T4) Constructor Using Create <T1, T2, T3, T4>(T1, T2, T3, T4) method Using ValueTuple 3 min read How to create 3-ValueTuple in C#? In C#, a triple or 3 value tuple is a value type tuple which holds three elements in it. You can create a triple value tuple using two different ways: Using ValueTuple <T1, T2, T3>(T1, T2, T3) Constructor Using Create <T1, T2, T3>(T1, T2, T3) Method Using ValueTuple <T1, T2, T3>(T1 3 min read How to create 8-ValueTuple in C#? In C#, an 8-ValueTuple is a value type tuple which contains eight elements and it is also known as octuple. You can create an 8-ValueTuple using two different ways: Using ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest<(T1, T2, T3, T4, T5, T6, T7, TRest) Constructor Using Create<T1, T2, T3, T4 5 min read How to create 7-ValueTuple in C#? In C#, a 7-ValueTuple is a value type tuple which contains seven elements and it is also known as septuple. You can create a 7-ValueTuple using two different ways: Using ValueTuple <T1, T2, T3, T4, T5, T6, T7>(T1, T2, T3, T4, T5, T6, T7) Constructor Using Create <T1, T2, T3, T4, T5, T6, T7 4 min read How to create 5-ValueTuple in C#? In C#, a 5-ValueTuple or quintuple is a value type tuple which contains five elements. You can create a 5-ValueTuple using two different ways: Using ValueTuple <T1, T2, T3, T4, T5>(T1, T2, T3, T4, T5) Constructor Using Create <T1, T2, T3, T4, T5>(T1, T2, T3, T4, T5) Method Using ValueTup 4 min read How to create 1-ValueTuple in C#? In C#, a Singleton or 1-ValueTuple is a value type tuple which holds only one Component. You can create a singleton value tuple using two different ways: Using ValueTuple <T1>(T1) Constructor Using Create <T1>(T1) Method Using ValueTuple <T1>(T1) Constructor You can create a single 2 min read Like