What s.find(c) supposed to return if char c is not in the string. What I mean is it described anywhere, because c++ documentation usually doesn’t say the most important things.
EDIT: More clearly: find returns the index of character we are looking for, what if it(character) is not there?
std::string::npos. But it’s generally better to usestd::find, because that returnss.end()and iterators are superior to indices.