I have an IDictionary<string,int> containing a distinct list of categories and respective counts with data looking something like this:
Category | Count ------------------- A | 2 B | 2 Z | 2 A_B | 1 A_B_C | 5
I’m looking for a query that sums the count of categories that start with common letters/string, so from the above the results I’m looking for is as follows:
Category | Count ------------------- A | 8 <- (a sum of A, A_B, A_B_C) B | 2 Z | 2 A_B | 6 <- (a sum of A_B, A_B_C) A_B_C | 5
1 Answer