Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. As we know that by using
Item<ElementNumber> property we can get the elements present in the tuples, but this property works only for seven elements. If you want to get the remaining element then you must go for
Rest property.
Rest property allows you to get the remaining element of the tuple other than the starting seven elements.
Syntax:
public TRest Rest { get; }
Here,
TRest is the value of the current
Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> object's remaining components.
Example:
Output:
Student Name: Mohan
Student Age: 24
Student Branch: CSE
Student Passing Year: 2016
Student Id: 209
Student Contact Number: 235678909
Student Fav Programming Language: C#
Student Rank: (1)
Note: You can also use Rest property to get the elements of the nested tuple.
Example: