The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....

Class TStringAccu

There are many situations where you need to count (sub)strings extracted from a text. For example, if you have a list of location names and you want to find out which locations are mentioned how often, then TStringAccu ("string accumulator") is the solution to it.

TStringAccu works as an accumulator of strings, either storing a string if it is not yet in the collection, or increasing the string count of a string which is already part of the collection.

Before using the class TStringAccu you have to clear the accumulator, and then add all strings by caling the method Add. The properties Elem and Count return the found strings and their counts, respectively. The property Size returns the number of different strings stored in TStringAccu.

Last Update: 2013-Mar-23