[VB.NET]Dictionary类

字典类是一个很重要的类,尤其是对于数据的简单存储,查询,和处理。

 

废话不多说,简单记录下我探索的结果。

 1、

Dictionary内部索引是0基的。也就是说第一个元素的序号是0.

2、

 1 Public Class DictionaryTryMain
 2 
 3     Private Sub btnClassBase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClassBase.Click
 4         Dim dicTest As New Dictionary(Of String, String)
 5         dicTest.Add("age", "24")
 6         dicTest.Add("love", "MJ、CM、VB、.NET")
 7         dicTest.Add("music", "Michael Jackson")
 8         dicTest.Add("fun", "Computer Programming")
 9         dicTest.Add("loc", "Hubei Wuhan")
10         Console.WriteLine(String.Format("Length Of Dictionary:{0}", dicTest.Count))
11         Console.WriteLine(String.Format("Exist Key(""age"")?={0}", dicTest.ContainsKey("age")))
12         Console.WriteLine(String.Format("Content Of Key ""age"":{0}", dicTest.Item("age")))
13     End Sub
14 End Class

 

转载于:https://www.cnblogs.com/sunsoftresearch/p/3959823.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值