Answers for "substrin occurance count in cpp"

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 "substrin occurance count in cpp"

Browse Popular Code Answers by Language