- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Tuple.Create method in C#
To create a tuple, use the Tuple.Create method.
Here we have set a tuple with a string and int −
var myTuple = Tuple.Create("marks", 100);
The following is an example that creates a tuple using Tuple.Create and displays the elements in a single line in C# −
Example
using System; class Demo { static void Main() { var myTuple = Tuple.Create("marks", 100); Console.WriteLine(myTuple); } }
Output
(marks, 100)
Advertisements