Parse String Line By Line
#include <iostream>
#include <string>
using namespace std;
string ResultsText;
string NextLine;
ResultsText = ....Your source string you want to parse line by line
stringstream ResultsTextStream(ResultsText);
while (getline(ResultsTextStream, NextLine))
{
std::cout << "Next Line: " << NextLine << std::endl;
}
Parse String Splitting By Delimiter Character
#include <iostream>
#include <string>
using namespace std;
string ResultsText;
string NextSection;
ResultsText = ....Your source string you want to parse line by line
stringstream ResultsTextStream(ResultsText);
while (getline(ResultsTextStream, NextSection, ',')) //<<<<Specify the delimiting character (it is removed from the NextSection output
{
std::cout << "Next Section: " << NextSection << std::endl;
}
