Answers for "c++ Count the number of occurrences of a given word in a Strin"

C++
1

string count occurrences c++

#include <algorithm>

std::string s = "a_b_c";
size_t n = std::count(s.begin(), s.end(), '_'); //n=2
Posted by: Guest on April-18-2021

Code answers related to "c++ Count the number of occurrences of a given word in a Strin"

Browse Popular Code Answers by Language