I need to split string by line. I used to do in the following way:
int doSegment(char *sentence, int segNum) { assert(pSegmenter != NULL); Logger &log =
I'd like to use std::getline or std::string::find to go through the string. below code demonstrates getline function
int doSegment(char *sentence) { std::stringstream ss(sentence); std::string to; if (sentence != NULL) { while(std::getline(ss,to,'\n')){ cout << to <