Is there another ( better ) way to get the second value from this string::find example:
Expand|Select|Wrap|Line Numbers
- std::string str( "More strings of the string variety" );
- size_t loc;
- loc = str.find( "string" );
- loc = str.find( "string", loc + 1, 6 );
- std::cout << "Location of second string: " << loc << '\n';
Now, if the "strings" were reversed:
Expand|Select|Wrap|Line Numbers
- std::string str( "My string is better than other strings." );
- size_t loc;
- loc = str.find( "strings", 0, 7 );
- std::cout << "Location of second string: " << loc << '\n';
I happened to run into this situation, and I thought, "Hey!" Maybe someone
at theScripts has a better way of doing this.
Thanks for your time.
Lates!
-Soneji