Best way to check if any value exists on ArrayList
.net, c#
Solution
Well, you could check the `.Count > 0`. But a better option would be stop using `ArrayList`. Since you know about `Any()` and `System.Linq`, I assume you're not using .NET 1.1; so use `List<T>` for some `T`, and all your problems will be solved. This has full LINQ-to-Objects usage, and is just a much better idea.
List<int> myInts = ...
bool anyAtAll = myInts.Any();
bool anyEvens = myInts.Any(x => (x % 2) == 0);
// etc
Problem
I have `ArrayList`. I want to check if any value exits in t his `ArrayList`. I would like to use Any method (from `System.Linq` namespace), but I can use it only on `Array`, not `ArrayList`. Is there any efficient way to check this?