1#include <algorithm>
2#include <vector>
3
4if ( std::find(vec.begin(), vec.end(), item) != vec.end() )
5 do_this();
6else
7 do_that();
1// find function for strings
2// my linkedin : https://www.linkedin.com/in/vaalarivan-prasanna-3a07bb203/
3str = "Ilayathapathy";
4subStr = "thalapathy";
5cout << str.find(subStr, 1); // prints 5 (first occurrence of substring \n
6// starting at index 1