I have what is essentially a jagged array of name value pairs - i need to generate a set of unique name values from this. the jagged array is approx 86,000 x 11 values. It d
How about:
Dictionary hs = new Dictionary();
foreach (i in jaggedArray)
{
foreach (j in i)
{
if (!hs.ContainsKey(j))
{
hs.Add(j, 0);
}
}
}
IEnumerable unique = hs.Keys;
of course, if you were using C# 3.0, .NET 3.5:
var hs = new HashSet();
hs.UnionWith(jaggedArray.SelectMany(item => item));
would do the trick.