I have a dictionary that contains a random amount of variables (differs depending on the document it's scanning) in the following format
- ,A, 500
- ,ORD, 50000
- ,ORD, 200
I need to be able to group together all of the values that belong to the same class (ORD being one and A being another) and then add the integers together so that I can output
A - 500
ORD - 50200
So I think I need to assign different integer variables depending on the amount of classes and then add them together but I really don't know how to go about it
EDIT to insert code:
Dim sharenum As Int32 = 0
Dim tempshold As String = ""
For Each sHolder In shareholders
tempshold = Replace(sHolder.numberShares, ",", "")
sharenum = Convert.ToInt32(tempshold)
dicClassShares.Add("," & Trim(sHolder.shareClass) & ",", sharenum)