Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set 6-item tuple in C#’
With C#, you can easily set a 6-item tuple.
The following is a 6-item tuple −
var myTuple = new Tuple<string, string[], int, int, int, int>("electronics",
new string[] { "shoes", "clothing#", "accessories" },
100,
250,
500,
1000);
above, we have tuple for string, string array and int as shown below −
Tuple<string, string[], int, int, int, int>
Here is the complete code −
Example
using System;
class Demo {
static void Main() {
var myTuple = new Tuple<string, string[], int, int, int, int>("electronics",
new string[] { "shoes", "clothing#", "accessories" },
100,
250,
500,
1000);
// Displaying Item 1
Console.WriteLine(myTuple.Item1);
// Displaying Item 5
Console.WriteLine(myTuple.Item5);
// Displaying Item 6
Console.WriteLine(myTuple.Item6);
}
}
Output
electronics 500 1000
Advertisements