Posts Tagged ‘occurrence’

Counting the number of occurrences of a given character in a std::string can be done using one function from the STL library: the std::count(…) function. This function takes three parameters: two iterators (the beginning and end of the desired search), and the item you wish to count. This function can be used for any STL […]