
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
Initialize a Tuple to an Empty Tuple in C#
To initialize a tuple to an empty tuple −
Tuple<string, string> myTuple;
If you want to check for values in a tuple, that whether it is null or not −
Example
using System; namespace Demo { class Program { static void Main(string[] args) { Tuple <int, string> tuple = new Tuple<int, string>(10, null); if (tuple.Item1 == 10) { Console.WriteLine(tuple.Item1); } if (tuple.Item2 == null) { Console.WriteLine("Item is null"); } } } }