Getting the String that Represent the Value of ValueTuple<T1,T2> Instance in C#
ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It allows you to store a data set that contains multiple values that may or may not be related to each other. You can also get a string that represents the value of the ValueTuple’s object with the help of the ToString Method.
This method returns a string that will represent the value of the ValueTuple<T1, T2> object. The string represented by this method is in the form of (Item1, Item2) here Item1 and Item2 represent the values of Item1 and Item2 properties, and it will represent a String.Empty if any property contains a null value.
public override string ToString ();
Return Type: The return type of this method is System.String. So, it will return a string that represents ValueTuple<T1, T2> object.
ValueTuple 1: (Rina) ValueTuple 2: (Rohan, 25)
NValueTuple 1: (Anu, 23, (C++, Java, Python, C#)) NValueTuple 2: (Boond, 27, Junior Engineer, (C++, Java)) NValueTuple 3: (Rohit, 25, HR, (C++, Java, C#)) NValueTuple 4: (Mohan, 26, Junior Engineer, (C++, Java, Python))