- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Creating an empty case-sensitive HybridDictionary Class in C#
To create an empty case-sensitive HybridDictionary, the code is as follows −
Example
using System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary dict = new HybridDictionary(false); dict.Add("A", "AB"); dict.Add("B", "BC"); dict.Add("C", "DE"); dict.Add("D", "de"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in dict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }
Output
This will produce the following output −
Key/Value pairs... Key = A, Value = AB Key = B, Value = BC Key = C, Value = DE Key = D, Value = de
Example
Let us see another example −
using System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary dict = new HybridDictionary(true); dict.Add("A", "AB"); dict.Add("B", "BC"); dict.Add("C", "DE"); dict.Add("D", "de"); dict.Add("e", "FG"); dict.Add("F", "gh"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in dict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }
Output
This will produce the following output −
Key/Value pairs... Key = A, Value = AB Key = B, Value = BC Key = C, Value = DE Key = D, Value = de Key = e, Value = FG Key = F, Value = gh
- Related Articles
- Creating an empty HybridDictionary with specified case sensitivity in C#
- Creating a Case-Sensitive HybridDictionary with specified initial size in C#
- HybridDictionary Class in C#?
- Creating a HybridDictionary with specified initial size in C#
- Case-sensitive sort in JavaScript
- Java Program to sort an array in case-sensitive order
- Case sensitive string comparison in Java.
- Is JavaScript a case sensitive language?
- How to achieve case sensitive uniqueness and case insensitive search in MySQL?
- What is the size of an object of an empty class in C++?
- How to create an empty class in Python?
- How to do case-sensitive string comparison in JavaScript?
- Why is the size of an empty class not zero in C++?
- How MySQL can perform case-sensitive string comparison?
- Are MySQL database and table names case-sensitive?

Advertisements