Searching Returns index of start of match s1.find(s2); first occurance of s2 in s1 s1.rfind(s2); last occurance of s2 in s1 std::string s1 = "abcdef---defghi"; std::string s2 = "def"; s1.find(s2); // returns 3 s1.rfind(s2); // returns 9