size_t find (const string& str, size_t pos = 0) const noexcept;
size_t find (const char* s, size_t pos = 0) const;
size_t find (const char* s, size_t pos, size_type n) const;
size_t find (char c, size_t pos = 0) const noexcept;
查找目的字符串中str
的首次出现位置,str
可以是string,const char*,char
,查找成功时返回匹配成功位置第一个字符在目的字符串中的位置
和find_first_of与find_last_of的区别
find_first_of,find_last_of
的语义是查找str
中某一个或连续几个字符在目的字符串中的首次或者最后一次出现的位置