#include <iostream> #include <vector> #include <algorithm> #include <iterator> using namespace std; int main() { string str("Bienvenu sur cpp.mesexemples.com"); ostream_iterator<char> out(cout, " "); vector<char>::iterator substring = find(str.begin(), str.end(), 'c'); cout << "La sous-chaîne à partir de cpp: "; copy(substring, str.end(), out); cout << endl; return 0; } /* La sous-chaîne à partir de cpp: c p p . m e s e x e m p l e s . c o m */ |
----------------------------------------------------------------------------