c# Best class to hold a list of values to look up after
I have a list of values that i need to check against a constant list to know wheter they 开发者_如何学运维are present or not (one by one).
Im using a dictionary buy it doesnt seem logical to have the value two times (key, value)...isnt there any class specialized for this case (and faster if possible)?
Also it would me more reasonable if it could be declared as a constant being a predefined list
Sounds like you need a HashSet.
Use HashSet<T>
.
HashSet
精彩评论