C#中创建具有指定的区分大小写的空HybridDictionary
要创建具有指定的区分大小写的空HybridDictionary,代码如下-
示例
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
热门推荐
10 鼓掌祝福语简短10字
11 朋友花篮开业祝福语简短
12 女神节日简短祝福语大全
13 宝宝生日祝福语大全简短
14 奶奶八十寿辰祝福语简短
15 龙年简短祝福语有哪些
16 简短霸气的考试祝福语
17 好听的元旦简短祝福语
18 婚礼祝福语简短精辟的