I have a std::string with multiple lines and I need to read it line by line. Please show me how to do it with a small example.
std::string
Ex: I have a string
There are several ways to do that.
You can use std::string::find in a loop for '\n' characters and substr() between the positions.
std::string::find
'\n'
You can use std::istringstream and std::getline( istr, line ) (Probably the easiest)
std::istringstream
std::getline( istr, line )
You can use boost::tokenize
boost::tokenize