detecting the occurrence of a sequence of characters in a string

The find member is also useful for detecting the occurrence of a sequence of characters in a string. Example :

#include <string>
#include <iostream>
using namespace std;
int main() 
{
    string chooseOne("mango, tango, django, kolanglk");
    int i = chooseOne.find("go");
    
    while(i != string::npos) 
    {
            cout <<"found on " << i <<" position" << endl;
            i++;
            i = chooseOne.find("go", i);
    }
    getchar();
    return 0;
}

Output :

found on 3 position
found on 10 position
found on 18 position