locate string in string c++ code example
Example 1: find substring in string c++
std::string parentstring = "Hello Agnosticdev, I love Tutorials";
std::string substring = "Agnosticdev";
auto index = parentstring.find(substring);
Example 2: find in string c++
size_t find (const string& str, size_t pos = 0) const;