Now this is example list :
List<List<KeyValuePair<string, double>>> dblWordFreqByCluster =
new List<List<KeyValuePair<string, double>>>();
What i want is getting the list count at this main list (dblWordFreqByCluster). Which means getting count of List<KeyValuePair<string, double>>
lists.
I can count them via making foreach iteration which i don't want to because i suppose that would cause unnecessary performance loss.
Using LINQ you could do
int totalCount = dblWordFreqByCluster.Sum(c => c.Count);
However, that isn't much different than using a foreach loop, but it would be less verbose and just as easy to read.
A simple:
List<List<KeyValuePair<string, double>>> dblWordFreqByCluster = new List<List<KeyValuePair<string, double>>>();
int count = dblWordFreqByCluster.count;
Should work...
Edited: I thought it was java ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With