strobj.find(str1,pos), what if position argument is out of the size?

Feb 27, 2014 at 3:53am
Will the following code make the find() search until the string::npos?

1
2
string l="hello";
l.find("hey",10);//out of range of l.size(); 
Feb 27, 2014 at 4:20am
http://en.cppreference.com/w/cpp/string/basic_string/find

If pos >= size(), the function always returns npos.
Feb 28, 2014 at 5:16am
thanks!
Topic archived. No new replies allowed.