Answers for "count occurrences of string in array c++"

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 "count occurrences of string in array c++"

Browse Popular Code Answers by Language