DarkConsultant
Programmer
Hi,
I have an array full of strings and I need to extract numbers of instances.
E.G.
Dim MyArray() as String = ("apple","banana","cat","apple")
How do I find out how many apples or banana's etc.
I currently iterate over the array and count them but Array.FindAll should work. I am having difficulty understanding the predicate function to return values although I use predicates in other parts of my code without a problem. If i want to return everything that starts with 'a' no problem I use a predicate that checks StartsWith("a") but I just need the quantity.
I am sure I am missing something so can anyone fill in the blanks?
DarkConsultant
Live long and prosper \\//
I have an array full of strings and I need to extract numbers of instances.
E.G.
Dim MyArray() as String = ("apple","banana","cat","apple")
How do I find out how many apples or banana's etc.
I currently iterate over the array and count them but Array.FindAll should work. I am having difficulty understanding the predicate function to return values although I use predicates in other parts of my code without a problem. If i want to return everything that starts with 'a' no problem I use a predicate that checks StartsWith("a") but I just need the quantity.
I am sure I am missing something so can anyone fill in the blanks?
DarkConsultant
Live long and prosper \\//