c++ string iterator "find first of" -
is there method in string iterator find_first_of on string ? like:
string::iterator it; string str(" h asdasf ^& saafa"); = find_first_of("&az^"); std::cout << *it << std::endl;
and result:
a
you can indirectly
auto pos = str.find_first_of("&az^");
then advance iterator
if(pos != std::string::npos) // @mike seymour std::advance(it, pos);
i guess can kind of std::find
lambda, above more simpler , concise.
Comments
Post a Comment