推荐.NET类的独特整数集? [英] Recommended .NET Class for a collection of unique integers?

查看:145
本文介绍了推荐.NET类的独特整数集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你有什么建议的,需要保持独特的整数的列表?类

What would you recommend for class that needs to keep a list of unique integers?

我会想加入()整数集合,并检查是否存在如载有()。

I'm going to want to Add() integers to the collection and also check for existence e.g. Contains().

将是很好,也让他们在一个列表作为字符串显示,IE浏览器。 1,5,10,21

Would be nice to also get them in a list as a string for display, ie. "1, 5, 10, 21".

推荐答案

HashSet的

这篇关于推荐.NET类的独特整数集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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