pr_wainwright
asked on
Looping StringBuilder strings
Hi,
I have a C# StringBuilder with the below strings:
2.1.1 ICSS
2.1.1 ICSS
2.1.1 ICSS
2.1.4 User Interface
2.1.4 User Interface
2.1.5 Alarm Management
2.1.5 Alarm Management
2.1.5 Alarm Management
2.1.5 Alarm Management
How can I loop through these strings & count the total of each type. e.g. The results would be:
2.1.1. ICSS = 3
2.1.4 User Interface = 2
2.1.5 Alarm management = 4
Thanks
Paul.
I have a C# StringBuilder with the below strings:
2.1.1 ICSS
2.1.1 ICSS
2.1.1 ICSS
2.1.4 User Interface
2.1.4 User Interface
2.1.5 Alarm Management
2.1.5 Alarm Management
2.1.5 Alarm Management
2.1.5 Alarm Management
How can I loop through these strings & count the total of each type. e.g. The results would be:
2.1.1. ICSS = 3
2.1.4 User Interface = 2
2.1.5 Alarm management = 4
Thanks
Paul.
ASKER
Idle_Mind,
I am using Visual Web Developer 2005. I have never used hash tables before. Any help on these appreciated.
Thanks
Paul.
I am using Visual Web Developer 2005. I have never used hash tables before. Any help on these appreciated.
Thanks
Paul.
How are the strings delimited in the StringBuilder?....are they separated by comma, tab, something else?....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I needed. Thanks.
Regardless, use a HashTable type structure and add a counter variable to it using the strings as the key. If the key already exists then increment the value already stored there.
What version C# are you using?