The Tuple<T>
Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>
Example:
Tuple<int, string, string> per =
new Tuple <int, string, string>(1, "Darshan", "Mitesh");
How to access tuple:
var person = Tuple.Create(1, "Darshan", "Jobs");
person.Item1; // returns 1
person.Item2; // returns "Darshan"
person.Item3; // returns "Jobs"
var numbers = Tuple.Create("One", 2, 3, "Four", 5, "Six", 7, 8);
numbers.Item1; // returns "One"
numbers.Item2; // returns 2
numbers.Item3; // returns 3
numbers.Item4; // returns "Four"
numbers.Item5; // returns 5
numbers.Item6; // returns "Six"
numbers.Item7; // returns 7
numbers.Rest; // returns (8)
No comments:
Post a Comment