নির্দিষ্ট ক্ষেত্রে সংবেদনশীলতা সহ একটি খালি হাইব্রিড অভিধান তৈরি করতে, কোডটি নিম্নরূপ -
উদাহরণ
using System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary myDict = new HybridDictionary(); myDict.Add("A", "AB"); myDict.Add("B", "BC"); myDict.Add("C", "DE"); myDict.Add("D", "FG"); myDict.Add("e", "fg"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in myDict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }
আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেKey/Value pairs... Key = A, Value = AB Key = B, Value = BC Key = C, Value = DE Key = D, Value = FG Key = e, Value = fg
উদাহরণ
আসুন আরেকটি উদাহরণ দেখি -
using System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary myDict = new HybridDictionary(); myDict.Add("A", "PQ"); myDict.Add("B", "BC"); myDict.Add("C", "tu"); myDict.Add("D", "FG"); myDict.Add("d", "gh"); myDict.Add("e", "fg"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in myDict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }
আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেKey/Value pairs... Key = A, Value = PQ Key = B, Value = BC Key = C, Value = tu Key = D, Value = FG Key = d, Value = gh Key = e, Value = fg