VB.NET problem has me baffled

Surely more simple would be (in C#, I don't use VB so won't attempt to translate):
Code:
return elements1.Count == elements2.Count 
  && elements1.Cast<string>().All(elements2.Contains);

That's certainly more concise, but his version allows for a number of items to differ, which that wouldn't do in its current form.
 
I love LINQ and associates. Probably the standout reason I enjoy C# (bar access to the rest of .NET as a whole).
 
Back
Top Bottom