📅  最后修改于: 2022-03-11 14:44:45.927000             🧑  作者: Mango
int nPos = str_to_search.find(str, 0);
while (nPos != string::npos)
{
count++;
nPos = str_to_search.find(str, nPos + str.size());
}