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 - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -