哪个集合存储唯一的字符串? [英] Which collection for storing unique strings?
本文介绍了哪个集合存储唯一的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一个集合,就像 Dictionary(OF Key,Value)
,但实际上并不需要一个键和值。钥匙本身就够了。所以像 Collection(Key)
这样的东西。它不应该接受重复键。
I'm looking for a collection just like Dictionary(OF Key, Value)
but I don't actually need a key and value. Key itself is enough. So something like Collection(Key)
. It shouldn't accept duplicate keys.
我已经在.NET Framework中查找了几个集合,但找不到我想要的。目前,我滥用字典(OF String,String)
,并将值设置为 Nothing
始终。
I've looked up couple of collections in .NET Framework but couldn't find what I want. Currently I'm abusing Dictionary(OF String, String)
and setting Value as Nothing
all the time.
我是否继续滥用字典(OF T,T)?
Shall I just continue abusing Dictionary(OF T,T)?
推荐答案
我想你想要的是 HashSet< T> 。
这篇关于哪个集合存储唯一的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文