4 ms·
Wouldn't `Count` ( https://docs.microsoft.com/en-us/dotnet/api/system.collections.icollection.count?view=net-6.0#system-collections-icollection-count https://do
by clappski 5y ago
Wouldn't `Count` ( https://docs.microsoft.com/en-us/dotnet/api/system.collections.icollection.count?view=net-6.0#system-collections-icollection-count https://docs.microsoft.com/en-us/dotnet/api/system.collectio... ) be the preferred way to check if a collection has values? `someCollection.Any()` is the same as Python's `any`
- smcl 5y agoI didn't mean specifically ICollection, maybe I just used the wrong word (probably "enumerable" or "sequence" is better?). But I was referring to this method: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any?view=net-6.0 https://docs.microsoft.com/en-us/dotnet/api/system.linq.enum... > Determines whether any element of a sequence exists or satisfies a condition.