Examples Using
find
0123456789012345678901234567890
str1 = “Programming and Problem Solving”;
str2 = “gram”;
Function Call
Value Returned by Function
str1.find(“and”)
12
str1.find(“Programming”)
0
str2.find(“and”)
string::npos
str1.find(“Pro”)
0