VB.NET容器,不添加不同的项目 [英] VB.NET container that doesn't add different items

查看:141
本文介绍了VB.NET容器,不添加不同的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.NET中有一个容器,当你添加一个已存在的项目时,没有任何反应(它没有添加)

例如,如果容器变量被命名为a那么

There is a container in VB.NET that when you add an item that already exists then nothing happens (it is not added )
for example if the container variable is named a then

a.add(1) a.add(1) a.add(2)

将导致a有两个项目(1,2)而不是三(1,1,2)

问题是我忘记了对象的名字

任何帮助?

谢谢!

will result in "a" having two items (1,2 ) and not three(1,1,2)
the problem is that I forgot the object's name
any help ?
thank you !

推荐答案

HashSet (T) [ ^ ](参见备注部分)。
HashSet(T)[^] (see the Remarks section).


这篇关于VB.NET容器,不添加不同的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆