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

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -