c# - 如何从 C# 中的数组中获取不同的值?

标签 c#

<分区>

Possible Duplicate:
Remove duplicates from array

如何从 C# 中的数组中获取不同的值

最佳答案

您可以使用 .Distinct()扩展方法。

var collectionWithDistinctElements = oldArray.Distinct().ToArray();

关于c# - 如何从 C# 中的数组中获取不同的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8816001/

相关文章:

c# - Asp.net动态数据修改列大小

c# - 在 C# 中读取 Excel 文件并在数据库中插入记录 - Windows Azure

c# - 如何防止 C# 控制台应用程序优先作为事件窗口?

c# - C# 中的 IIR 低通滤波器在 x86 模式下中断

c# - 从不同的应用程序域(复合 UI)获取对 UserControl 的引用

c# - 使用 Azure 存储模拟器测试开发

C# REST API 客户端

c# - test studio - 新浏览器失败

c# - WebBrowser 与 WebBrowserBase 类

c# - 具有静态成员的未引用对象的 .NET GC