find a string in string cpp code example
Example 1: find character in string c++
auto char_to_find = 'a'
if (str.find(char_to_find) != std::string::npos) {
// character found
}
Example 2: find in string c++
size_t find (const string& str, size_t pos = 0) const;